diff --git a/bsp/buildroot/CHANGES b/bsp/buildroot/CHANGES index cdf68216..cf35c540 100644 --- a/bsp/buildroot/CHANGES +++ b/bsp/buildroot/CHANGES @@ -1,3 +1,77 @@ +2018.02.8, Released November 26th, 2018 + + Important / security related fixes. + + fs: Drop intermediate tarball from the filesystem handling to + fix an issue with xattrs handling related to fakeroot. Ensure + tarball target includes xattrs. + + download: Fix confusion in git submodule handling if dl/ is a + symlink. + + toolchain: Only allow enabling stack protection on + architectures with control flow integrity (CFI) support. Only + allow FORTIFY_SOURCE support on gcc >= 6. + + genrandconfig: Fix missing newline in BR2_WGET handling, + causing the following line to be ignored. This would affect + BR2_ENABLE_DEBUG, BR2_INIT_BUSYBOX, BR2_INIT_SYSTEMD, + BR2_ROOTFS_DEVICE_CREATION_DYNAMIC_EUDEV, BR2_STATIC_LIBS or + BR2_PACKAGE_PYTHON_PY_ONLY depending on the randomization. + + show-build-order: Also include the dependencies of + rootfs-common. + + Defconfigs: Fixes for Armadeus APF27, imx6sabre. + + graph-depends: Fix for package names starting with a non-alpha + character. + + Updated/fixed packages: attr, audit, bind, brotli, easydbus, + elfutils, gauche, gcc, giflib, gpsd, lcdproc, libcurl, + libiscsi, libnfs, libnspr, libnss, libkcapi, libsemanage, + liburiparser, lighttpd, linux, lua-curl, mariadb, mmc-utils, + mosquitto, mysql, neardal, netplug, network-manager, + nfs-utils, nginx, openocd, openswan, p11-kit, postgresql, + prosody, qemu, qt, rpm, ruby, samba4, squid, supertuxkart, + systemd, tar, trace-cmd, traceroute, twolame, uclibc, + usb_modeswitch, vtun, webkitgtk, xdriver_xf86-video-geode, + xlib_libfontenc, xproto_inputproto, xserver_xorg-server + + Issues resolved (http://bugs.uclibc.org): + + #11086: download/git submodule breaks on symlinked dl folder + #11251: Util scanpypi failes when package change - to _ in.. + #11476: stdio2.h error invalid use of __builtin_va_arg_pack + #11481: Docs: Is external.desc required? + +2018.02.7, Released October 25th, 2018 + + Important / security related fixes. + + Detect and reject build paths containing '@', as this confuses + a number of packages, including GCC. + + utils/get-developers: Add -e option for use with git + send-email. + + utils/diffconfig: Make it work for (non-Buildroot) config + files not using the BR2_ prefix. + + u-boot: Fix for environment image handling on big endian + systems. + + Updated/fixed packages: binutils, ca-certificates, + cups-filters, erlang, libarchive, libcurl, libssh, live555, + ljlinenoise, file, freetype, gcc, git, gvfs, leveldb, mariadb, + mongoose, netsnmp, nmap, nodejs, ntp, open-plc-utils, poco, + psmisc, qptpd2, python-enum34, qemu, qt, qt5base, spice, + spice-protocols, setools, tinc, ustr, wireshark + + Issues resolved (http://bugs.uclibc.org): + + #11396: uboot environment image checksum invalid if target is big endian + 2018.02.6, Released October 7th, 2018 Important / security related fixes. diff --git a/bsp/buildroot/Config.in b/bsp/buildroot/Config.in index 52fb53bc..102c8010 100644 --- a/bsp/buildroot/Config.in +++ b/bsp/buildroot/Config.in @@ -67,6 +67,9 @@ config BR2_HOST_GCC_AT_LEAST_8 default y if BR2_HOST_GCC_VERSION = "8" select BR2_HOST_GCC_AT_LEAST_7 +# When adding new entries above, be sure to update +# the HOSTCC_MAX_VERSION variable in the Makefile. + # Hidden boolean selected by packages in need of Java in order to build # (example: kodi) config BR2_NEEDS_HOST_JAVA @@ -795,6 +798,8 @@ config BR2_FORTIFY_SOURCE_NONE config BR2_FORTIFY_SOURCE_1 bool "Conservative" + # gcc bug https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61164 + depends on !BR2_TOOLCHAIN_BUILDROOT || BR2_TOOLCHAIN_GCC_AT_LEAST_6 help This option sets _FORTIFY_SOURCE to 1 and only introduces checks that shouldn't change the behavior of conforming @@ -802,6 +807,8 @@ config BR2_FORTIFY_SOURCE_1 config BR2_FORTIFY_SOURCE_2 bool "Aggressive" + # gcc bug https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61164 + depends on !BR2_TOOLCHAIN_BUILDROOT || BR2_TOOLCHAIN_GCC_AT_LEAST_6 help This option sets _FORTIFY_SOURCES to 2 and some more checking is added, but some conforming programs might fail. diff --git a/bsp/buildroot/Makefile b/bsp/buildroot/Makefile index 36614a8c..989d86f1 100644 --- a/bsp/buildroot/Makefile +++ b/bsp/buildroot/Makefile @@ -60,6 +60,11 @@ override O := $(patsubst %/,%,$(patsubst %.,%,$(O))) # avoid empty CANONICAL_O in case on non-existing entry. CANONICAL_O := $(shell mkdir -p $(O) >/dev/null 2>&1)$(realpath $(O)) +# gcc fails to build when the srcdir contains a '@' +ifneq ($(findstring @,$(CANONICAL_O)),) +$(error The build directory can not contain a '@') +endif + CANONICAL_CURDIR = $(realpath $(CURDIR)) REQ_UMASK = 0022 @@ -87,9 +92,9 @@ all: .PHONY: all # Set and export the version string -export BR2_VERSION := 2018.02.6 +export BR2_VERSION := 2018.02.8 # Actual time the release is cut (for reproducible builds) -BR2_VERSION_EPOCH = 1538896000 +BR2_VERSION_EPOCH = 1543272000 # Save running make version since it's clobbered by the make package RUNNING_MAKE_VERSION := $(MAKE_VERSION) @@ -355,8 +360,14 @@ export HOSTARCH := $(shell LC_ALL=C $(HOSTCC_NOCCACHE) -v 2>&1 | \ -e 's/macppc/powerpc/' \ -e 's/sh.*/sh/' ) -HOSTCC_VERSION := $(shell $(HOSTCC_NOCCACHE) --version | \ - sed -n -r 's/^.* ([0-9]*)\.([0-9]*)\.([0-9]*)[ ]*.*/\1 \2/p') +# When adding a new host gcc version in Config.in, +# update the HOSTCC_MAX_VERSION variable: +HOSTCC_MAX_VERSION := 8 + +HOSTCC_VERSION := $(shell V=$$($(HOSTCC_NOCCACHE) --version | \ + sed -n -r 's/^.* ([0-9]*)\.([0-9]*)\.([0-9]*)[ ]*.*/\1 \2/p'); \ + [ "$${V%% *}" -le $(HOSTCC_MAX_VERSION) ] || V=$(HOSTCC_MAX_VERSION); \ + printf "%s" "$${V}") # For gcc >= 5.x, we only need the major version. ifneq ($(firstword $(HOSTCC_VERSION)),4) diff --git a/bsp/buildroot/VERSION b/bsp/buildroot/VERSION index e5a2805c..1d909543 100644 --- a/bsp/buildroot/VERSION +++ b/bsp/buildroot/VERSION @@ -1 +1 @@ -buildroot 2018_02_6 +buildroot 2018_02_8 diff --git a/bsp/buildroot/board/freescale/imx6sabre/patches/uboot/0002-imx-Create-distinct-pre-processed-mkimage-config-fil.patch b/bsp/buildroot/board/freescale/imx6sabre/patches/uboot/0002-imx-Create-distinct-pre-processed-mkimage-config-fil.patch new file mode 100644 index 00000000..b8989cb9 --- /dev/null +++ b/bsp/buildroot/board/freescale/imx6sabre/patches/uboot/0002-imx-Create-distinct-pre-processed-mkimage-config-fil.patch @@ -0,0 +1,89 @@ +From 27a2cd6a1980adf3002412678c8fdec6528dc47d Mon Sep 17 00:00:00 2001 +From: Trent Piepho +Date: Fri, 6 Apr 2018 17:11:27 -0700 +Subject: [PATCH] imx: Create distinct pre-processed mkimage config files + +Each imx image is created by a separate sub-make and during this process +the mkimage config file is run though cpp. + +The cpp output is to the same file no matter what imx image is being +created. + +This means if two imx images are generated in parallel they will attempt +to independently produce the same pre-processed mkimage config file at +the same time. + +Avoid the problem by making the pre-processed config file name unique +based on the imx image it will be used in. This way each image will +create a unique config file and they won't clobber each other when run +in parallel. + +This should fixed the build bug referenced in b5b0e4e3 ("imximage: +Remove failure when no IVT offset is found"). + +Cc: Breno Lima +Cc: Thomas Petazzoni +Cc: Fabio Estevam +Signed-off-by: Trent Piepho +Tested-by: Fabio Estevam +[fabio: Adapted to imx_v2017.03_4.9.11_1.0.0_ga] +Signed-off-by: Fabio Estevam +--- + arch/arm/imx-common/Makefile | 15 ++++++++------- + 1 file changed, 8 insertions(+), 7 deletions(-) + +diff --git a/arch/arm/imx-common/Makefile b/arch/arm/imx-common/Makefile +index d862258..f1bae8d 100644 +--- a/arch/arm/imx-common/Makefile ++++ b/arch/arm/imx-common/Makefile +@@ -69,9 +69,11 @@ endif + quiet_cmd_cpp_cfg = CFGS $@ + cmd_cpp_cfg = $(CPP) $(cpp_flags) -x c -o $@ $< + +-IMX_CONFIG = $(CONFIG_IMX_CONFIG:"%"=%).cfgtmp ++# mkimage source config file ++IMX_CONFIG = $(CONFIG_IMX_CONFIG:"%"=%) + +-$(IMX_CONFIG): %.cfgtmp: % FORCE ++# How to create a cpp processed config file, they all use the same source ++%.cfgout: $(IMX_CONFIG) FORCE + $(Q)mkdir -p $(dir $@) + $(call if_changed_dep,cpp_cfg) + +@@ -79,7 +81,7 @@ MKIMAGEFLAGS_u-boot.imx = -n $(filter-out $(PLUGIN).bin $< $(PHONY),$^) -T imxim + -e $(CONFIG_SYS_TEXT_BASE) + u-boot.imx: MKIMAGEOUTPUT = u-boot.imx.log + +-u-boot.imx: u-boot.bin $(IMX_CONFIG) $(PLUGIN).bin FORCE ++u-boot.imx: u-boot.bin u-boot.cfgout $(PLUGIN).bin FORCE + $(call if_changed,mkimage) + + ifeq ($(CONFIG_OF_SEPARATE),y) +@@ -87,16 +89,15 @@ MKIMAGEFLAGS_u-boot-dtb.imx = -n $(filter-out $(PLUGIN).bin $< $(PHONY),$^) -T i + -e $(CONFIG_SYS_TEXT_BASE) + u-boot-dtb.imx: MKIMAGEOUTPUT = u-boot-dtb.imx.log + +-u-boot-dtb.imx: u-boot-dtb.bin $(IMX_CONFIG) $(PLUGIN).bin FORCE ++u-boot-dtb.imx: u-boot-dtb.bin u-boot-dtb.cfgout $(PLUGIN).bin FORCE + $(call if_changed,mkimage) + endif + + MKIMAGEFLAGS_SPL = -n $(filter-out $(PLUGIN).bin $< $(PHONY),$^) -T imximage \ + -e $(CONFIG_SPL_TEXT_BASE) +- + SPL: MKIMAGEOUTPUT = SPL.log + +-SPL: spl/u-boot-spl.bin $(IMX_CONFIG) $(PLUGIN).bin FORCE ++SPL: spl/u-boot-spl.bin spl/u-boot-spl.cfgout $(PLUGIN).bin FORCE + $(call if_changed,mkimage) + + MKIMAGEFLAGS_u-boot.uim = -A arm -O U-Boot -a $(CONFIG_SYS_TEXT_BASE) \ +@@ -124,4 +125,4 @@ cmd_u-boot-nand-spl_imx = (printf '\000\000\000\000\106\103\102\040\001' && \ + spl/u-boot-nand-spl.imx: SPL FORCE + $(call if_changed,u-boot-nand-spl_imx) + +-targets += $(addprefix ../../../,$(IMX_CONFIG) SPL u-boot.uim spl/u-boot-nand-spl.imx) ++targets += $(addprefix ../../../,SPL spl/u-boot-spl.cfgout u-boot-dtb.cfgout u-boot.cfgout u-boot.uim spl/u-boot-nand-spl.imx) +-- +2.7.4 + diff --git a/bsp/buildroot/board/freescale/imx6sabre/patches/uboot/0002-imximage-Remove-failure-when-no-IVT-offset-is-found.patch b/bsp/buildroot/board/freescale/imx6sabre/patches/uboot/0002-imximage-Remove-failure-when-no-IVT-offset-is-found.patch deleted file mode 100644 index 92eff757..00000000 --- a/bsp/buildroot/board/freescale/imx6sabre/patches/uboot/0002-imximage-Remove-failure-when-no-IVT-offset-is-found.patch +++ /dev/null @@ -1,55 +0,0 @@ -From 24ba28680abe868e8db3442a9bf523ad3af1febd Mon Sep 17 00:00:00 2001 -From: Fabio Estevam -Date: Fri, 9 Mar 2018 08:25:00 -0300 -Subject: [PATCH] imximage: Remove failure when no IVT offset is found - -Sometimes imximage throws the following error: - - CFGS board/freescale/vf610twr/imximage.cfg.cfgtmp - CFGS board/freescale/vf610twr/imximage.cfg.cfgtmp - MKIMAGE u-boot-dtb.imx -Error: No BOOT_FROM tag in board/freescale/vf610twr/imximage.cfg.cfgtmp -arch/arm/mach-imx/Makefile:100: recipe for target 'u-boot-dtb.imx' failed - -Later on, when running mkimage for the u-boot.imx it will succeed in -finding the IVT offset. - -Looks like some race condition happening during parallel build when -processing mkimage for u-boot-dtb.imx and u-boot.imx. - -A proper fix still needs to be implemented, but as a workaround let's -remove the error when the IVT offset is not found. - -It is useful to have such message, especially during bring-up phase, -but the build error that it causes is severe, so better avoid the -build error for now. - -The error checking can be re-implemented later when we have a proper -fix. - -Reported-by: Breno Lima -Reported-by: Thomas Petazzoni -Signed-off-by: Fabio Estevam ---- - tools/imximage.c | 5 ----- - 1 file changed, 5 deletions(-) - -diff --git a/tools/imximage.c b/tools/imximage.c -index 0c43196..bef56f8 100644 ---- a/tools/imximage.c -+++ b/tools/imximage.c -@@ -765,11 +765,6 @@ static uint32_t parse_cfg_file(struct imx_header *imxhdr, char *name) - (*set_dcd_rst)(imxhdr, dcd_len, name, lineno); - fclose(fd); - -- /* Exit if there is no BOOT_FROM field specifying the flash_offset */ -- if (imximage_ivt_offset == FLASH_OFFSET_UNDEFINED) { -- fprintf(stderr, "Error: No BOOT_FROM tag in %s\n", name); -- exit(EXIT_FAILURE); -- } - return dcd_len; - } - --- -2.7.4 - diff --git a/bsp/buildroot/boot/uboot/uboot.mk b/bsp/buildroot/boot/uboot/uboot.mk index 27946d99..14fe3702 100644 --- a/bsp/buildroot/boot/uboot/uboot.mk +++ b/bsp/buildroot/boot/uboot/uboot.mk @@ -262,7 +262,7 @@ define UBOOT_GENERATE_ENV_IMAGE >$(@D)/buildroot-env.txt $(HOST_DIR)/bin/mkenvimage -s $(BR2_TARGET_UBOOT_ENVIMAGE_SIZE) \ $(if $(BR2_TARGET_UBOOT_ENVIMAGE_REDUNDANT),-r) \ - $(if $(filter BIG,$(BR2_ENDIAN)),-b) \ + $(if $(filter "BIG",$(BR2_ENDIAN)),-b) \ -o $(BINARIES_DIR)/uboot-env.bin \ $(@D)/buildroot-env.txt endef diff --git a/bsp/buildroot/configs/armadeus_apf27_defconfig b/bsp/buildroot/configs/armadeus_apf27_defconfig index 6f78b74d..457a14b0 100644 --- a/bsp/buildroot/configs/armadeus_apf27_defconfig +++ b/bsp/buildroot/configs/armadeus_apf27_defconfig @@ -28,4 +28,7 @@ BR2_LINUX_KERNEL_INTREE_DTS_NAME="imx27-apf27dev" # U-boot BR2_TARGET_UBOOT=y -BR2_TARGET_UBOOT_BOARDNAME="apf27" +BR2_TARGET_UBOOT_BUILD_SYSTEM_KCONFIG=y +BR2_TARGET_UBOOT_CUSTOM_VERSION=y +BR2_TARGET_UBOOT_CUSTOM_VERSION_VALUE="2018.09" +BR2_TARGET_UBOOT_BOARD_DEFCONFIG="apf27" diff --git a/bsp/buildroot/configs/at91sam9x5ek_dev_defconfig b/bsp/buildroot/configs/at91sam9x5ek_dev_defconfig index 3af4ba74..3f711ffe 100644 --- a/bsp/buildroot/configs/at91sam9x5ek_dev_defconfig +++ b/bsp/buildroot/configs/at91sam9x5ek_dev_defconfig @@ -60,7 +60,6 @@ BR2_PACKAGE_DTC_PROGRAMS=y BR2_PACKAGE_BLUEZ_UTILS=y BR2_PACKAGE_BRIDGE_UTILS=y BR2_PACKAGE_CAN_UTILS=y -BR2_PACKAGE_DROPBEAR=y BR2_PACKAGE_ETHTOOL=y BR2_PACKAGE_IPERF=y BR2_PACKAGE_IPROUTE2=y diff --git a/bsp/buildroot/configs/at91sam9x5ek_mmc_dev_defconfig b/bsp/buildroot/configs/at91sam9x5ek_mmc_dev_defconfig index 931cf7de..73c90a49 100644 --- a/bsp/buildroot/configs/at91sam9x5ek_mmc_dev_defconfig +++ b/bsp/buildroot/configs/at91sam9x5ek_mmc_dev_defconfig @@ -63,7 +63,6 @@ BR2_PACKAGE_DTC_PROGRAMS=y BR2_PACKAGE_BLUEZ_UTILS=y BR2_PACKAGE_BRIDGE_UTILS=y BR2_PACKAGE_CAN_UTILS=y -BR2_PACKAGE_DROPBEAR=y BR2_PACKAGE_ETHTOOL=y BR2_PACKAGE_IPERF=y BR2_PACKAGE_IPROUTE2=y diff --git a/bsp/buildroot/configs/atmel_sama5d27_som1_ek_mmc_dev_defconfig b/bsp/buildroot/configs/atmel_sama5d27_som1_ek_mmc_dev_defconfig index 37521292..0c041501 100644 --- a/bsp/buildroot/configs/atmel_sama5d27_som1_ek_mmc_dev_defconfig +++ b/bsp/buildroot/configs/atmel_sama5d27_som1_ek_mmc_dev_defconfig @@ -52,7 +52,6 @@ BR2_PACKAGE_DTC_PROGRAMS=y BR2_PACKAGE_BLUEZ_UTILS=y BR2_PACKAGE_BRIDGE_UTILS=y BR2_PACKAGE_CAN_UTILS=y -BR2_PACKAGE_DROPBEAR=y BR2_PACKAGE_ETHTOOL=y BR2_PACKAGE_IPERF=y BR2_PACKAGE_IPROUTE2=y diff --git a/bsp/buildroot/configs/atmel_sama5d2_xplained_mmc_dev_defconfig b/bsp/buildroot/configs/atmel_sama5d2_xplained_mmc_dev_defconfig index 23a25820..4563ed11 100644 --- a/bsp/buildroot/configs/atmel_sama5d2_xplained_mmc_dev_defconfig +++ b/bsp/buildroot/configs/atmel_sama5d2_xplained_mmc_dev_defconfig @@ -66,7 +66,6 @@ BR2_PACKAGE_DTC_PROGRAMS=y BR2_PACKAGE_BLUEZ_UTILS=y BR2_PACKAGE_BRIDGE_UTILS=y BR2_PACKAGE_CAN_UTILS=y -BR2_PACKAGE_DROPBEAR=y BR2_PACKAGE_ETHTOOL=y BR2_PACKAGE_IPERF=y BR2_PACKAGE_IPROUTE2=y diff --git a/bsp/buildroot/configs/atmel_sama5d3_xplained_dev_defconfig b/bsp/buildroot/configs/atmel_sama5d3_xplained_dev_defconfig index f403e230..6a5ed375 100644 --- a/bsp/buildroot/configs/atmel_sama5d3_xplained_dev_defconfig +++ b/bsp/buildroot/configs/atmel_sama5d3_xplained_dev_defconfig @@ -62,7 +62,6 @@ BR2_PACKAGE_DTC_PROGRAMS=y BR2_PACKAGE_BLUEZ_UTILS=y BR2_PACKAGE_BRIDGE_UTILS=y BR2_PACKAGE_CAN_UTILS=y -BR2_PACKAGE_DROPBEAR=y BR2_PACKAGE_ETHTOOL=y BR2_PACKAGE_IPERF=y BR2_PACKAGE_IPROUTE2=y diff --git a/bsp/buildroot/configs/atmel_sama5d3_xplained_mmc_dev_defconfig b/bsp/buildroot/configs/atmel_sama5d3_xplained_mmc_dev_defconfig index a3351482..37112ce4 100644 --- a/bsp/buildroot/configs/atmel_sama5d3_xplained_mmc_dev_defconfig +++ b/bsp/buildroot/configs/atmel_sama5d3_xplained_mmc_dev_defconfig @@ -65,7 +65,6 @@ BR2_PACKAGE_DTC_PROGRAMS=y BR2_PACKAGE_BLUEZ_UTILS=y BR2_PACKAGE_BRIDGE_UTILS=y BR2_PACKAGE_CAN_UTILS=y -BR2_PACKAGE_DROPBEAR=y BR2_PACKAGE_ETHTOOL=y BR2_PACKAGE_IPERF=y BR2_PACKAGE_IPROUTE2=y diff --git a/bsp/buildroot/configs/atmel_sama5d4_xplained_dev_defconfig b/bsp/buildroot/configs/atmel_sama5d4_xplained_dev_defconfig index 7ebfde17..266411ff 100644 --- a/bsp/buildroot/configs/atmel_sama5d4_xplained_dev_defconfig +++ b/bsp/buildroot/configs/atmel_sama5d4_xplained_dev_defconfig @@ -63,7 +63,6 @@ BR2_PACKAGE_DTC_PROGRAMS=y BR2_PACKAGE_BLUEZ_UTILS=y BR2_PACKAGE_BRIDGE_UTILS=y BR2_PACKAGE_CAN_UTILS=y -BR2_PACKAGE_DROPBEAR=y BR2_PACKAGE_ETHTOOL=y BR2_PACKAGE_IPERF=y BR2_PACKAGE_IPROUTE2=y diff --git a/bsp/buildroot/configs/atmel_sama5d4_xplained_mmc_dev_defconfig b/bsp/buildroot/configs/atmel_sama5d4_xplained_mmc_dev_defconfig index c31f15a1..a2958319 100644 --- a/bsp/buildroot/configs/atmel_sama5d4_xplained_mmc_dev_defconfig +++ b/bsp/buildroot/configs/atmel_sama5d4_xplained_mmc_dev_defconfig @@ -66,7 +66,6 @@ BR2_PACKAGE_DTC_PROGRAMS=y BR2_PACKAGE_BLUEZ_UTILS=y BR2_PACKAGE_BRIDGE_UTILS=y BR2_PACKAGE_CAN_UTILS=y -BR2_PACKAGE_DROPBEAR=y BR2_PACKAGE_ETHTOOL=y BR2_PACKAGE_IPERF=y BR2_PACKAGE_IPROUTE2=y diff --git a/bsp/buildroot/configs/imx6-sabresd_qt5_defconfig b/bsp/buildroot/configs/imx6-sabresd_qt5_defconfig index 8e6065db..6e178eed 100644 --- a/bsp/buildroot/configs/imx6-sabresd_qt5_defconfig +++ b/bsp/buildroot/configs/imx6-sabresd_qt5_defconfig @@ -43,6 +43,7 @@ BR2_LINUX_KERNEL_DEFCONFIG="imx_v6_v7" BR2_LINUX_KERNEL_DTS_SUPPORT=y BR2_LINUX_KERNEL_INTREE_DTS_NAME="imx6q-sabresd imx6dl-sabresd imx6qp-sabresd" BR2_LINUX_KERNEL_CONFIG_FRAGMENT_FILES="board/freescale/imx6-sabresd/linux_qt5.fragment" +BR2_LINUX_KERNEL_NEEDS_HOST_OPENSSL=y # GL driver BR2_PACKAGE_MESA3D=y diff --git a/bsp/buildroot/docs/manual/customize-directory-structure.txt b/bsp/buildroot/docs/manual/customize-directory-structure.txt index b177319f..a3a7ad4c 100644 --- a/bsp/buildroot/docs/manual/customize-directory-structure.txt +++ b/bsp/buildroot/docs/manual/customize-directory-structure.txt @@ -50,6 +50,7 @@ to you. | +-- Config.in (if using a br2-external tree) +-- external.mk (if using a br2-external tree) ++-- external.desc (if using a br2-external tree) ------ Details on the files shown above are given further in this chapter. diff --git a/bsp/buildroot/docs/manual/manual.html b/bsp/buildroot/docs/manual/manual.html index 5bfb0f96..01b8258e 100644 --- a/bsp/buildroot/docs/manual/manual.html +++ b/bsp/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. Graphing the dependencies between packages
8.9. Graphing the build duration
8.10. Graphing the filesystem size contribution of packages
8.11. Integration with Eclipse
8.12. 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. Frequently Asked Questions & Troubleshooting
10.1. The boot hangs after Starting network…
10.2. Why is there no compiler on the target?
10.3. Why are there no development files on the target?
10.4. Why is there no documentation on the target?
10.5. Why are some packages not visible in the Buildroot config menu?
10.6. Why not use the target directory as a chroot directory?
10.7. Why doesn’t Buildroot generate binary packages (.deb, .ipkg…)?
10.8. How to speed-up the build process?
11. Known issues
12. Legal notice and licensing
12.1. Complying with open source licenses
12.2. Complying with the Buildroot license
13. Beyond Buildroot
13.1. Boot the generated images
13.2. Chroot
III. Developer guide
14. How Buildroot works
15. Coding style
15.1. Config.in file
15.2. The .mk file
15.3. The documentation
15.4. Support scripts
16. Adding support for a particular board
17. Adding new packages to Buildroot
17.1. Package directory
17.2. Config files
17.3. The .mk file
17.4. The .hash file
17.5. Infrastructure for packages with specific build systems
17.6. Infrastructure for autotools-based packages
17.7. Infrastructure for CMake-based packages
17.8. Infrastructure for Python packages
17.9. Infrastructure for LuaRocks-based packages
17.10. Infrastructure for Perl/CPAN packages
17.11. Infrastructure for virtual packages
17.12. Infrastructure for packages using kconfig for configuration files
17.13. Infrastructure for rebar-based packages
17.14. Infrastructure for Waf-based packages
17.15. Integration of Meson-based packages
17.16. Integration of Cargo-based packages
17.17. Infrastructure for packages building kernel modules
17.18. Infrastructure for asciidoc documents
17.19. Infrastructure specific to the Linux kernel package
17.20. Hooks available in the various build steps
17.21. Gettext integration and interaction with packages
17.22. Tips and tricks
17.23. Conclusion
18. Patching a package
18.1. Providing patches
18.2. How patches are applied
18.3. Format and licensing of the package patches
18.4. Integrating patches found on the Web
19. Download infrastructure
20. Debugging Buildroot
21. Contributing to Buildroot
21.1. Reproducing, analyzing and fixing bugs
21.2. Analyzing and fixing autobuild failures
21.3. Reviewing and testing patches
21.4. Work on items from the TODO list
21.5. Submitting patches
21.6. Reporting issues/bugs or getting help
22. DEVELOPERS file and get-developers
IV. Appendix
23. Makedev syntax documentation
24. Makeusers syntax documentation
25. Migrating from older Buildroot versions
25.1. Migrating to 2016.11
25.2. Migrating to 2017.08

Buildroot 2018.02.6 manual generated on 2018-10-07 -07:20:36 UTC from git revision 67d61cbef5

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. Graphing the dependencies between packages
8.9. Graphing the build duration
8.10. Graphing the filesystem size contribution of packages
8.11. Integration with Eclipse
8.12. 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. Frequently Asked Questions & Troubleshooting
10.1. The boot hangs after Starting network…
10.2. Why is there no compiler on the target?
10.3. Why are there no development files on the target?
10.4. Why is there no documentation on the target?
10.5. Why are some packages not visible in the Buildroot config menu?
10.6. Why not use the target directory as a chroot directory?
10.7. Why doesn’t Buildroot generate binary packages (.deb, .ipkg…)?
10.8. How to speed-up the build process?
11. Known issues
12. Legal notice and licensing
12.1. Complying with open source licenses
12.2. Complying with the Buildroot license
13. Beyond Buildroot
13.1. Boot the generated images
13.2. Chroot
III. Developer guide
14. How Buildroot works
15. Coding style
15.1. Config.in file
15.2. The .mk file
15.3. The documentation
15.4. Support scripts
16. Adding support for a particular board
17. Adding new packages to Buildroot
17.1. Package directory
17.2. Config files
17.3. The .mk file
17.4. The .hash file
17.5. Infrastructure for packages with specific build systems
17.6. Infrastructure for autotools-based packages
17.7. Infrastructure for CMake-based packages
17.8. Infrastructure for Python packages
17.9. Infrastructure for LuaRocks-based packages
17.10. Infrastructure for Perl/CPAN packages
17.11. Infrastructure for virtual packages
17.12. Infrastructure for packages using kconfig for configuration files
17.13. Infrastructure for rebar-based packages
17.14. Infrastructure for Waf-based packages
17.15. Integration of Meson-based packages
17.16. Integration of Cargo-based packages
17.17. Infrastructure for packages building kernel modules
17.18. Infrastructure for asciidoc documents
17.19. Infrastructure specific to the Linux kernel package
17.20. Hooks available in the various build steps
17.21. Gettext integration and interaction with packages
17.22. Tips and tricks
17.23. Conclusion
18. Patching a package
18.1. Providing patches
18.2. How patches are applied
18.3. Format and licensing of the package patches
18.4. Integrating patches found on the Web
19. Download infrastructure
20. Debugging Buildroot
21. Contributing to Buildroot
21.1. Reproducing, analyzing and fixing bugs
21.2. Analyzing and fixing autobuild failures
21.3. Reviewing and testing patches
21.4. Work on items from the TODO list
21.5. Submitting patches
21.6. Reporting issues/bugs or getting help
22. DEVELOPERS file and get-developers
IV. Appendix
23. Makedev syntax documentation
24. Makeusers syntax documentation
25. Migrating from older Buildroot versions
25.1. Migrating to 2016.11
25.2. Migrating to 2017.08

Buildroot 2018.02.8 manual generated on 2018-11-26 +22:42:29 UTC from git revision d047c4032b

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-2018 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 @@ -16,8 +16,8 @@ processors everyone is used to having in his PC. They can be PowerPC processors, MIPS processors, ARM processors, etc.

Buildroot supports numerous processors and their variants; it also comes with default configurations for several boards available off-the-shelf. Besides this, a number of third-party projects are based on, -or develop their BSP [1] or -SDK [2] on top of Buildroot.



[1] BSP: Board Support Package

[2] SDK: Software Development Kit

Chapter 2. System requirements

Buildroot is designed to run on Linux systems.

While Buildroot itself will build most host packages it needs for the +or develop their BSP [1] or +SDK [2] on top of Buildroot.



[1] BSP: Board Support Package

[2] SDK: Software Development Kit

Chapter 2. System requirements

Buildroot is designed to run on Linux systems.

While Buildroot itself will build most host packages it needs for the compilation, certain standard Linux utilities are expected to be already installed on the host system. Below you will find an overview of the mandatory and optional packages (note that package names may vary @@ -272,7 +272,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 @@ -547,7 +547,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 @@ -1147,7 +1147,8 @@ to you.

+-- board/
 |           +-- package2.mk
 |
 +-- Config.in (if using a br2-external tree)
-+-- external.mk (if using a br2-external tree)

Details on the files shown above are given further in this chapter.

Note: if you choose to place this structure outside of the Buildroot ++-- external.mk (if using a br2-external tree) ++-- external.desc (if using a br2-external tree)

Details on the files shown above are given further in this chapter.

Note: if you choose to place this structure outside of the Buildroot tree but in a br2-external tree, the <company> and possibly <boardname> components may be superfluous and can be left out.

9.1.1. Implementing layered customizations

It is quite common for a user to have several related projects that partly need the same customizations. Instead of duplicating these @@ -2629,7 +2630,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 17.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 17.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 17.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 17.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 @@ -4803,7 +4804,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. @@ -4885,7 +4886,7 @@ pastebin service. Note that not all available pastebin services will preserve Unix-style line terminators when downloading raw pastes. Following pastebin services are known to work correctly: - https://gist.github.com/ -- http://code.bulix.org/



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

    Chapter 22. DEVELOPERS file and get-developers

    The main Buildroot directory contains a file named DEVELOPERS that +- http://code.bulix.org/



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

    Chapter 22. 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-developer tool allows to:

    • Calculate the list of developers to whom patches should be sent, by diff --git a/bsp/buildroot/docs/manual/manual.pdf b/bsp/buildroot/docs/manual/manual.pdf index 167521c5..e490b559 100644 Binary files a/bsp/buildroot/docs/manual/manual.pdf and b/bsp/buildroot/docs/manual/manual.pdf differ diff --git a/bsp/buildroot/docs/manual/manual.text b/bsp/buildroot/docs/manual/manual.text index 9c7c4fb8..d4be2f8d 100644 --- a/bsp/buildroot/docs/manual/manual.text +++ b/bsp/buildroot/docs/manual/manual.text @@ -160,13 +160,13 @@ List of Examples --------------------------------------------------------------------- -Buildroot 2018.02.6 manual generated on 2018-10-07 07:20:42 UTC from -git revision 67d61cbef5 +Buildroot 2018.02.8 manual generated on 2018-11-26 22:42:34 UTC from +git revision d047c4032b 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= -67d61cbef5ff190b803745b332d0f7d7177210fc] file in the Buildroot +d047c4032bbbece009d84094dae2092d9582df06] file in the Buildroot sources for the full text of this license. Copyright © 2004-2018 The Buildroot developers @@ -1894,6 +1894,7 @@ choice is up to you. | +-- Config.in (if using a br2-external tree) +-- external.mk (if using a br2-external tree) ++-- external.desc (if using a br2-external tree) Details on the files shown above are given further in this chapter. diff --git a/bsp/buildroot/fs/common.mk b/bsp/buildroot/fs/common.mk index 6d579db8..ac8fd4c2 100644 --- a/bsp/buildroot/fs/common.mk +++ b/bsp/buildroot/fs/common.mk @@ -122,7 +122,7 @@ rootfs-$(1): $$(BINARIES_DIR)/rootfs.$(1) ifeq ($$(BR2_TARGET_ROOTFS_$(2)),y) TARGETS_ROOTFS += rootfs-$(1) -PACKAGES += $$(filter-out rootfs-%,$$(ROOTFS_$(2)_DEPENDENCIES)) +PACKAGES += $$(filter-out rootfs-%,$$(ROOTFS_$(2)_DEPENDENCIES) $$(ROOTFS_COMMON_DEPENDENCIES)) endif # Check for legacy POST_TARGETS rules diff --git a/bsp/buildroot/fs/tar/tar.mk b/bsp/buildroot/fs/tar/tar.mk index e39c2fdb..55351197 100644 --- a/bsp/buildroot/fs/tar/tar.mk +++ b/bsp/buildroot/fs/tar/tar.mk @@ -8,7 +8,7 @@ TAR_OPTS := $(call qstrip,$(BR2_TARGET_ROOTFS_TAR_OPTIONS)) define ROOTFS_TAR_CMD (cd $(TARGET_DIR); find -print0 | LC_ALL=C sort -z | \ - tar $(TAR_OPTS) -cf $@ --null --no-recursion -T - --numeric-owner) + tar $(TAR_OPTS) -cf $@ --null --xattrs-include='*' --no-recursion -T - --numeric-owner) endef $(eval $(rootfs)) diff --git a/bsp/buildroot/linux/linux.mk b/bsp/buildroot/linux/linux.mk index cc5aeb69..38a67edc 100644 --- a/bsp/buildroot/linux/linux.mk +++ b/bsp/buildroot/linux/linux.mk @@ -287,6 +287,9 @@ define LINUX_KCONFIG_FIXUP_CMDS $(call KCONFIG_ENABLE_OPT,CONFIG_DEVTMPFS_MOUNT,$(@D)/.config)) $(if $(BR2_ROOTFS_DEVICE_CREATION_DYNAMIC_EUDEV), $(call KCONFIG_ENABLE_OPT,CONFIG_INOTIFY_USER,$(@D)/.config)) + $(if $(BR2_PACKAGE_AUDIT), + $(call KCONFIG_ENABLE_OPT,CONFIG_NET,$(@D)/.config) + $(call KCONFIG_ENABLE_OPT,CONFIG_AUDIT,$(@D)/.config)) $(if $(BR2_PACKAGE_KTAP), $(call KCONFIG_ENABLE_OPT,CONFIG_DEBUG_FS,$(@D)/.config) $(call KCONFIG_ENABLE_OPT,CONFIG_ENABLE_DEFAULT_TRACERS,$(@D)/.config) @@ -413,9 +416,7 @@ define LINUX_INSTALL_HOST_TOOLS # Installing dtc (device tree compiler) as host tool, if selected if grep -q "CONFIG_DTC=y" $(@D)/.config; then \ $(INSTALL) -D -m 0755 $(@D)/scripts/dtc/dtc $(HOST_DIR)/bin/linux-dtc ; \ - if [ ! -e $(HOST_DIR)/bin/dtc ]; then \ - ln -sf linux-dtc $(HOST_DIR)/bin/dtc ; \ - fi \ + $(if $(BR2_PACKAGE_HOST_DTC),,ln -sf linux-dtc $(HOST_DIR)/bin/dtc;) \ fi endef diff --git a/bsp/buildroot/package/attr/0002-Switch-back-to-syscall.patch b/bsp/buildroot/package/attr/0002-Switch-back-to-syscall.patch new file mode 100644 index 00000000..de879e23 --- /dev/null +++ b/bsp/buildroot/package/attr/0002-Switch-back-to-syscall.patch @@ -0,0 +1,126 @@ +From 14adc898a36948267bfe5c63b399996879e94c98 Mon Sep 17 00:00:00 2001 +From: Andreas Gruenbacher +Date: Fri, 17 Aug 2018 14:07:31 +0200 +Subject: Switch back to syscall() + +Switch back to syscall() for the *xattr system calls. The current +mechanism of forwarding those calls to glibc breaks libraries like +libfakeroot (fakeroot) and libasan (the gcc address sanitizer; gcc +-fsanitize=address). + +Those libraries provide wrappers for functions defined in other shared +libraries, usually glibc, do their own processing, and forward calls to +the original symbols looke dup via dlsym(RTLD_NEXT, "symbol_name"). In +our case, dlsym returns the libattr_*xattr wrappers. However, when our +wrappers try calling glibc, they end up calling the libfakeroot / +libasan wrappers instead because those override the original symbols => +recursion. + +The libattr_*xattr wrappers will only be used when symbols are looked up +at runtime (dlopen / dlsym). Programs linking against libattr will +directly use the glibc provided symbols. Therefore, the slightly worse +performance of syscall() won't affect any of the "normal" users of +libattr. + +[nicolas.cavallari: with uclibc-ng, the recursion always happen] +Signed-off-by: Nicolas Cavallari +--- + libattr/syscalls.c | 26 ++++++++++++++------------ + 1 file changed, 14 insertions(+), 12 deletions(-) + +diff --git a/libattr/syscalls.c b/libattr/syscalls.c +index 3013aa0..721ad7f 100644 +--- a/libattr/syscalls.c ++++ b/libattr/syscalls.c +@@ -22,6 +22,8 @@ + + #include "config.h" + ++#include ++#include + #include + + #ifdef HAVE_VISIBILITY_ATTRIBUTE +@@ -31,67 +33,67 @@ + int libattr_setxattr(const char *path, const char *name, + void *value, size_t size, int flags) + { +- return setxattr(path, name, value, size, flags); ++ return syscall(__NR_setxattr, path, name, value, size, flags); + } + + int libattr_lsetxattr(const char *path, const char *name, + void *value, size_t size, int flags) + { +- return lsetxattr(path, name, value, size, flags); ++ return syscall(__NR_lsetxattr, path, name, value, size, flags); + } + + int libattr_fsetxattr(int filedes, const char *name, + void *value, size_t size, int flags) + { +- return fsetxattr(filedes, name, value, size, flags); ++ return syscall(__NR_fsetxattr, filedes, name, value, size, flags); + } + + ssize_t libattr_getxattr(const char *path, const char *name, + void *value, size_t size) + { +- return getxattr(path, name, value, size); ++ return syscall(__NR_getxattr, path, name, value, size); + } + + ssize_t libattr_lgetxattr(const char *path, const char *name, + void *value, size_t size) + { +- return lgetxattr(path, name, value, size); ++ return syscall(__NR_lgetxattr, path, name, value, size); + } + + ssize_t libattr_fgetxattr(int filedes, const char *name, + void *value, size_t size) + { +- return fgetxattr(filedes, name, value, size); ++ return syscall(__NR_fgetxattr, filedes, name, value, size); + } + + ssize_t libattr_listxattr(const char *path, char *list, size_t size) + { +- return listxattr(path, list, size); ++ return syscall(__NR_listxattr, path, list, size); + } + + ssize_t libattr_llistxattr(const char *path, char *list, size_t size) + { +- return llistxattr(path, list, size); ++ return syscall(__NR_llistxattr, path, list, size); + } + + ssize_t libattr_flistxattr(int filedes, char *list, size_t size) + { +- return flistxattr(filedes, list, size); ++ return syscall(__NR_flistxattr, filedes, list, size); + } + + int libattr_removexattr(const char *path, const char *name) + { +- return removexattr(path, name); ++ return syscall(__NR_removexattr, path, name); + } + + int libattr_lremovexattr(const char *path, const char *name) + { +- return lremovexattr(path, name); ++ return syscall(__NR_lremovexattr, path, name); + } + + int libattr_fremovexattr(int filedes, const char *name) + { +- return fremovexattr(filedes, name); ++ return syscall(__NR_fremovexattr, filedes, name); + } + + #ifdef HAVE_VISIBILITY_ATTRIBUTE +-- +cgit v1.0-41-gc330 + diff --git a/bsp/buildroot/package/audit/0001-Fix-audispd-path-in-auditd.conf.patch b/bsp/buildroot/package/audit/0001-Fix-audispd-path-in-auditd.conf.patch new file mode 100644 index 00000000..ccf45db9 --- /dev/null +++ b/bsp/buildroot/package/audit/0001-Fix-audispd-path-in-auditd.conf.patch @@ -0,0 +1,32 @@ +From 6e1fd09f7bc131c8f16d9cc43e2455ba4650c651 Mon Sep 17 00:00:00 2001 +From: Carlos Santos +Date: Sat, 3 Nov 2018 08:25:58 -0300 +Subject: [PATCH] Fix audispd path in auditd.conf + +audispd is installed at /usr/sbin but the configuration file pointed +to /sbin, causing auditd to fail on startup. + +This patch cannot be sent upstream because audispd does not exist +anymore on the master branch (it was merged to auditd). + +Signed-off-by: Carlos Santos +--- + init.d/auditd.conf | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/init.d/auditd.conf b/init.d/auditd.conf +index 4dcda83..998904f 100644 +--- a/init.d/auditd.conf ++++ b/init.d/auditd.conf +@@ -13,7 +13,7 @@ max_log_file = 8 + num_logs = 5 + priority_boost = 4 + disp_qos = lossy +-dispatcher = /sbin/audispd ++dispatcher = /usr/sbin/audispd + name_format = NONE + ##name = mydomain + max_log_file_action = ROTATE +-- +2.17.1 + diff --git a/bsp/buildroot/package/audit/S01auditd b/bsp/buildroot/package/audit/S02auditd similarity index 100% rename from bsp/buildroot/package/audit/S01auditd rename to bsp/buildroot/package/audit/S02auditd diff --git a/bsp/buildroot/package/audit/audit.hash b/bsp/buildroot/package/audit/audit.hash index fb375777..d8c11a3d 100644 --- a/bsp/buildroot/package/audit/audit.hash +++ b/bsp/buildroot/package/audit/audit.hash @@ -1,4 +1,4 @@ #Locally computed -sha256 67b59b2b77afee9ed87afa4d80ffc8e6f3a1f4bbedd5f2871f387c952147bcba audit-2.8.2.tar.gz +sha256 a410694d09fc5708d980a61a5abcb9633a591364f1ecc7e97ad5daef9c898c38 audit-2.8.4.tar.gz sha256 32b1062f7da84967e7019d01ab805935caa7ab7321a7ced0e30ebe75e5df1670 COPYING sha256 f18a0811fa0e220ccbc42f661545e77f0388631e209585ed582a1c693029c6aa COPYING.LIB diff --git a/bsp/buildroot/package/audit/audit.mk b/bsp/buildroot/package/audit/audit.mk index 2f6e6653..0988f88d 100644 --- a/bsp/buildroot/package/audit/audit.mk +++ b/bsp/buildroot/package/audit/audit.mk @@ -4,7 +4,7 @@ # ################################################################################ -AUDIT_VERSION = 2.8.2 +AUDIT_VERSION = 2.8.4 AUDIT_SITE = http://people.redhat.com/sgrubb/audit AUDIT_LICENSE = GPL-2.0+ (programs), LGPL-2.1+ (libraries) AUDIT_LICENSE_FILES = COPYING COPYING.LIB @@ -38,7 +38,7 @@ AUDIT_CONF_OPTS += --disable-systemd endif define AUDIT_INSTALL_INIT_SYSV - $(INSTALL) -D -m 755 package/audit/S01auditd $(TARGET_DIR)/etc/init.d/S01auditd + $(INSTALL) -D -m 755 package/audit/S02auditd $(TARGET_DIR)/etc/init.d/S02auditd endef define AUDIT_INSTALL_INIT_SYSTEMD diff --git a/bsp/buildroot/package/bind/0002-cross.patch b/bsp/buildroot/package/bind/0001-cross.patch similarity index 100% rename from bsp/buildroot/package/bind/0002-cross.patch rename to bsp/buildroot/package/bind/0001-cross.patch diff --git a/bsp/buildroot/package/bind/0003-Rename-ptrsize-to-ptr_size.patch b/bsp/buildroot/package/bind/0003-Rename-ptrsize-to-ptr_size.patch deleted file mode 100644 index e3b58e20..00000000 --- a/bsp/buildroot/package/bind/0003-Rename-ptrsize-to-ptr_size.patch +++ /dev/null @@ -1,74 +0,0 @@ -From 254dc19788ba2a03504fc6d1036fef477a60035f Mon Sep 17 00:00:00 2001 -From: Gustavo Zacarias -Date: Fri, 22 Jan 2016 08:31:02 -0300 -Subject: [PATCH] Rename ptrsize to ptr_size - -This is to compensate for a uClibc mess caused by commit -70a04a287a2875c82e6822c36e071afba5b63a62 where ptrsize is defined for -mips, hence causing build breakage under certain conditions for programs -that use this variable name. - -Status: definitely not upstreamable. - -Signed-off-by: Gustavo Zacarias ---- - lib/dns/rbt.c | 6 +++--- - lib/dns/rbtdb.c | 4 ++-- - 2 files changed, 5 insertions(+), 5 deletions(-) - -diff --git a/lib/dns/rbt.c b/lib/dns/rbt.c -index 86b5183..5fd55de 100644 ---- a/lib/dns/rbt.c -+++ b/lib/dns/rbt.c -@@ -113,7 +113,7 @@ struct file_header { - * information about the system on which the map file was generated - * will be used to tell if we can load the map file or not - */ -- isc_uint32_t ptrsize; -+ isc_uint32_t ptr_size; - unsigned int bigendian:1; /* big or little endian system */ - unsigned int rdataset_fixed:1; /* compiled with --enable-rrset-fixed */ - unsigned int nodecount; /* shadow from rbt structure */ -@@ -517,7 +517,7 @@ write_header(FILE *file, dns_rbt_t *rbt, isc_uint64_t first_node_offset, - memmove(header.version1, FILE_VERSION, sizeof(header.version1)); - memmove(header.version2, FILE_VERSION, sizeof(header.version2)); - header.first_node_offset = first_node_offset; -- header.ptrsize = (isc_uint32_t) sizeof(void *); -+ header.ptr_size = (isc_uint32_t) sizeof(void *); - header.bigendian = (1 == htonl(1)) ? 1 : 0; - - #ifdef DNS_RDATASET_FIXED -@@ -902,7 +902,7 @@ dns_rbt_deserialize_tree(void *base_address, size_t filesize, - } - #endif - -- if (header->ptrsize != (isc_uint32_t) sizeof(void *)) { -+ if (header->ptr_size != (isc_uint32_t) sizeof(void *)) { - result = ISC_R_INVALIDFILE; - goto cleanup; - } -diff --git a/lib/dns/rbtdb.c b/lib/dns/rbtdb.c -index c7168cb..dbcf944 100644 ---- a/lib/dns/rbtdb.c -+++ b/lib/dns/rbtdb.c -@@ -114,7 +114,7 @@ typedef struct rbtdb_file_header rbtdb_file_header_t; - - struct rbtdb_file_header { - char version1[32]; -- isc_uint32_t ptrsize; -+ isc_uint32_t ptr_size; - unsigned int bigendian:1; - isc_uint64_t tree; - isc_uint64_t nsec; -@@ -7593,7 +7593,7 @@ rbtdb_write_header(FILE *rbtfile, off_t tree_location, off_t nsec_location, - memset(&header, 0, sizeof(rbtdb_file_header_t)); - memmove(header.version1, FILE_VERSION, sizeof(header.version1)); - memmove(header.version2, FILE_VERSION, sizeof(header.version2)); -- header.ptrsize = (isc_uint32_t) sizeof(void *); -+ header.ptr_size = (isc_uint32_t) sizeof(void *); - header.bigendian = (1 == htonl(1)) ? 1 : 0; - header.tree = (isc_uint64_t) tree_location; - header.nsec = (isc_uint64_t) nsec_location; --- -2.4.10 - diff --git a/bsp/buildroot/package/bind/bind.hash b/bsp/buildroot/package/bind/bind.hash index 19d5f61f..ea76108c 100644 --- a/bsp/buildroot/package/bind/bind.hash +++ b/bsp/buildroot/package/bind/bind.hash @@ -1,4 +1,4 @@ -# Verified from https://ftp.isc.org/isc/bind9/9.11.4-P1/bind-9.11.4-P1.tar.gz.asc +# Verified from https://ftp.isc.org/isc/bind9/9.11.5/bind-9.11.5.tar.gz.asc # with key BE0E9748B718253A28BB89FFF1B11BF05CF02E57 -sha256 a85af7b629109d41285c7adeae1515daac638bbe4d5dc30d1f4b343dff09d811 bind-9.11.4-P2.tar.gz +sha256 a4cae11dad954bdd4eb592178f875bfec09fcc7e29fe0f6b7a4e5b5c6bc61322 bind-9.11.5.tar.gz sha256 336f3c40e37a1a13690efb4c63e20908faa4c40498cc02f3579fb67d3a1933a5 COPYRIGHT diff --git a/bsp/buildroot/package/bind/bind.mk b/bsp/buildroot/package/bind/bind.mk index 4b80eaf0..b5424a99 100644 --- a/bsp/buildroot/package/bind/bind.mk +++ b/bsp/buildroot/package/bind/bind.mk @@ -4,7 +4,7 @@ # ################################################################################ -BIND_VERSION = 9.11.4-P2 +BIND_VERSION = 9.11.5 BIND_SITE = http://ftp.isc.org/isc/bind9/$(BIND_VERSION) # bind does not support parallel builds. BIND_MAKE = $(MAKE1) diff --git a/bsp/buildroot/package/binutils/2.27/0100-elf32-arm-no-data-fix.patch b/bsp/buildroot/package/binutils/2.27/0100-elf32-arm-no-data-fix.patch deleted file mode 100644 index c6b0e7ef..00000000 --- a/bsp/buildroot/package/binutils/2.27/0100-elf32-arm-no-data-fix.patch +++ /dev/null @@ -1,22 +0,0 @@ -bfd/ChangeLog -2016-08-23 Nick Clifton - - * elf32-arm.c (elf32_arm_count_additional_relocs): Return zero if - there is no arm data associated with the section. - -[Thomas: taken from https://lists.gnu.org/archive/html/bug-binutils/2016-08/msg00165.html.] -Signed-off-by: Thomas Petazzoni - -diff --git a/bfd/elf32-arm.c b/bfd/elf32-arm.c -index 1eba21b..4478238 100644 ---- a/bfd/elf32-arm.c -+++ b/bfd/elf32-arm.c -@@ -18688,7 +18688,7 @@ elf32_arm_count_additional_relocs (asection *sec) - { - struct _arm_elf_section_data *arm_data; - arm_data = get_arm_elf_section_data (sec); -- return arm_data->additional_reloc_count; -+ return arm_data == NULL ? 0 : arm_data->additional_reloc_count; - } - - /* Called to set the sh_flags, sh_link and sh_info fields of OSECTION which diff --git a/bsp/buildroot/package/binutils/2.27/0120-sh-conf.patch b/bsp/buildroot/package/binutils/2.27/0120-sh-conf.patch deleted file mode 100644 index cc14ef40..00000000 --- a/bsp/buildroot/package/binutils/2.27/0120-sh-conf.patch +++ /dev/null @@ -1,46 +0,0 @@ -From 1ceee199e9a32034c6def7700fdbb26335ca76a3 Mon Sep 17 00:00:00 2001 -From: Romain Naour -Date: Fri, 25 Dec 2015 11:38:13 +0100 -Subject: [PATCH] sh-conf - -Likewise, binutils has no idea about any of these new targets either, so we -fix that up too.. now we're able to actually build a real toolchain for -sh2a_nofpu- and other more ineptly named toolchains (and yes, there are more -inept targets than that one, really. Go look, I promise). - -[Romain: rebase on top of 2.26] -Signed-off-by: Romain Naour ---- - configure | 2 +- - configure.ac | 2 +- - 2 files changed, 2 insertions(+), 2 deletions(-) - -diff --git a/configure b/configure -index 34b66f7..905bc7b 100755 ---- a/configure -+++ b/configure -@@ -3939,7 +3939,7 @@ case "${target}" in - or1k*-*-*) - noconfigdirs="$noconfigdirs gdb" - ;; -- sh-*-* | sh64-*-*) -+ sh*-*-* | sh64-*-*) - case "${target}" in - sh*-*-elf) - ;; -diff --git a/configure.ac b/configure.ac -index 4977d97..1e69ee2 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -1276,7 +1276,7 @@ case "${target}" in - or1k*-*-*) - noconfigdirs="$noconfigdirs gdb" - ;; -- sh-*-* | sh64-*-*) -+ sh*-*-* | sh64-*-*) - case "${target}" in - sh*-*-elf) - ;; --- -2.4.3 - diff --git a/bsp/buildroot/package/binutils/2.27/0130-tc-xtensa.c-fixup-xg_reverse_shift_count-typo.patch b/bsp/buildroot/package/binutils/2.27/0130-tc-xtensa.c-fixup-xg_reverse_shift_count-typo.patch deleted file mode 100644 index 79736078..00000000 --- a/bsp/buildroot/package/binutils/2.27/0130-tc-xtensa.c-fixup-xg_reverse_shift_count-typo.patch +++ /dev/null @@ -1,33 +0,0 @@ -From 78fb7e37eb8bb08ae537d6c487996ff17c810332 Mon Sep 17 00:00:00 2001 -From: Trevor Saunders -Date: Mon, 26 Sep 2016 12:42:11 -0400 -Subject: [PATCH] tc-xtensa.c: fixup xg_reverse_shift_count typo - -gas/ChangeLog: - -2016-09-26 Trevor Saunders - - * config/tc-xtensa.c (xg_reverse_shift_count): Pass cnt_arg instead of - cnt_argp to concat. - -Signed-off-by: Max Filippov ---- - gas/config/tc-xtensa.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/gas/config/tc-xtensa.c b/gas/config/tc-xtensa.c -index d062044..ca261ae 100644 ---- a/gas/config/tc-xtensa.c -+++ b/gas/config/tc-xtensa.c -@@ -2228,7 +2228,7 @@ xg_reverse_shift_count (char **cnt_argp) - cnt_arg = *cnt_argp; - - /* replace the argument with "31-(argument)" */ -- new_arg = concat ("31-(", cnt_argp, ")", (char *) NULL); -+ new_arg = concat ("31-(", cnt_arg, ")", (char *) NULL); - - free (cnt_arg); - *cnt_argp = new_arg; --- -2.1.4 - diff --git a/bsp/buildroot/package/binutils/2.27/0131-xtensa-fix-memory-corruption-by-broken-sysregs.patch b/bsp/buildroot/package/binutils/2.27/0131-xtensa-fix-memory-corruption-by-broken-sysregs.patch deleted file mode 100644 index 30103ee0..00000000 --- a/bsp/buildroot/package/binutils/2.27/0131-xtensa-fix-memory-corruption-by-broken-sysregs.patch +++ /dev/null @@ -1,42 +0,0 @@ -From 3c8788dbb70b40e737d4b8e30cab81406e5c5091 Mon Sep 17 00:00:00 2001 -From: Max Filippov -Date: Wed, 2 Aug 2017 00:36:05 -0700 -Subject: [PATCH] xtensa: fix memory corruption by broken sysregs - -In some xtensa configurations there may be system/user registers in -xtensa-modules with negative index. ISA initialization for such config -may clobber heap and result in program termination. -Don't update lookup table entries for register with negative indices. -They are not directly accessible via RSR/WSR/XSR or RUR/WUR, so this -change should not affect processing of valid assembly/binary code. - -bfd/ -2017-08-02 Max Filippov - - * xtensa-isa.c (xtensa_isa_init): Don't update lookup table - entries for sysregs with negative indices. - -Signed-off-by: Max Filippov ---- -Backported from: d84ed528d4817b0ff854006b65a9f6ec75f0407a - - bfd/xtensa-isa.c | 3 ++- - 1 file changed, 2 insertions(+), 1 deletion(-) - -diff --git a/bfd/xtensa-isa.c b/bfd/xtensa-isa.c -index 8da75bea8109..8c6ee88fdeae 100644 ---- a/bfd/xtensa-isa.c -+++ b/bfd/xtensa-isa.c -@@ -292,7 +292,8 @@ xtensa_isa_init (xtensa_isa_status *errno_p, char **error_msg_p) - xtensa_sysreg_internal *sreg = &isa->sysregs[n]; - is_user = sreg->is_user; - -- isa->sysreg_table[is_user][sreg->number] = n; -+ if (sreg->number >= 0) -+ isa->sysreg_table[is_user][sreg->number] = n; - } - - /* Set up the interface lookup table. */ --- -2.1.4 - diff --git a/bsp/buildroot/package/binutils/2.27/0300-ld-makefile.patch b/bsp/buildroot/package/binutils/2.27/0300-ld-makefile.patch deleted file mode 100644 index 73cc0980..00000000 --- a/bsp/buildroot/package/binutils/2.27/0300-ld-makefile.patch +++ /dev/null @@ -1,41 +0,0 @@ -From d76a7549b43974fe8564971a3f40459bc495a8a7 Mon Sep 17 00:00:00 2001 -From: Romain Naour -Date: Fri, 25 Dec 2015 11:40:53 +0100 -Subject: [PATCH] ld-makefile - -[Romain: rebase on top of 2.26] -Signed-off-by: Romain Naour ---- - ld/Makefile.am | 2 +- - ld/Makefile.in | 2 +- - 2 files changed, 2 insertions(+), 2 deletions(-) - -diff --git a/ld/Makefile.am b/ld/Makefile.am -index 0b3b049..3871c74 100644 ---- a/ld/Makefile.am -+++ b/ld/Makefile.am -@@ -57,7 +57,7 @@ endif - # We put the scripts in the directory $(scriptdir)/ldscripts. - # We can't put the scripts in $(datadir) because the SEARCH_DIR - # directives need to be different for native and cross linkers. --scriptdir = $(tooldir)/lib -+scriptdir = $(libdir) - - EMUL = @EMUL@ - EMULATION_OFILES = @EMULATION_OFILES@ -diff --git a/ld/Makefile.in b/ld/Makefile.in -index ed98f87..530e4c9 100644 ---- a/ld/Makefile.in -+++ b/ld/Makefile.in -@@ -413,7 +413,7 @@ AM_CFLAGS = $(WARN_CFLAGS) $(ELF_CLFAGS) - # We put the scripts in the directory $(scriptdir)/ldscripts. - # We can't put the scripts in $(datadir) because the SEARCH_DIR - # directives need to be different for native and cross linkers. --scriptdir = $(tooldir)/lib -+scriptdir = $(libdir) - BASEDIR = $(srcdir)/.. - BFDDIR = $(BASEDIR)/bfd - INCDIR = $(BASEDIR)/include --- -2.4.3 - diff --git a/bsp/buildroot/package/binutils/2.27/0301-check-ldrunpath-length.patch b/bsp/buildroot/package/binutils/2.27/0301-check-ldrunpath-length.patch deleted file mode 100644 index 3b4c204c..00000000 --- a/bsp/buildroot/package/binutils/2.27/0301-check-ldrunpath-length.patch +++ /dev/null @@ -1,36 +0,0 @@ -From ebe1cba46df52d7bf86def3d681271fd05fb453b Mon Sep 17 00:00:00 2001 -From: Romain Naour -Date: Fri, 25 Dec 2015 11:41:47 +0100 -Subject: [PATCH] check-ldrunpath-length - -[Romain: rebase on top of 2.26] -Signed-off-by: Romain Naour ---- - ld/emultempl/elf32.em | 4 ++++ - 1 file changed, 4 insertions(+) - -diff --git a/ld/emultempl/elf32.em b/ld/emultempl/elf32.em -index 0405d4f..efd3300 100644 ---- a/ld/emultempl/elf32.em -+++ b/ld/emultempl/elf32.em -@@ -1242,6 +1242,8 @@ fragment <link.next) - if (bfd_get_flavour (abfd) == bfd_target_elf_flavour) --- -2.4.3 - diff --git a/bsp/buildroot/package/binutils/2.27/0500-add-sysroot-fix-from-bug-3049.patch b/bsp/buildroot/package/binutils/2.27/0500-add-sysroot-fix-from-bug-3049.patch deleted file mode 100644 index f67a43ef..00000000 --- a/bsp/buildroot/package/binutils/2.27/0500-add-sysroot-fix-from-bug-3049.patch +++ /dev/null @@ -1,52 +0,0 @@ -From 30628870e583375f8927c04398c7219c6e9f703c Mon Sep 17 00:00:00 2001 -From: Romain Naour -Date: Fri, 25 Dec 2015 11:42:48 +0100 -Subject: [PATCH] add sysroot fix from bug #3049 - -Always try to prepend the sysroot prefix to absolute filenames first. - -http://bugs.gentoo.org/275666 -http://sourceware.org/bugzilla/show_bug.cgi?id=10340 - -Signed-off-by: Sven Rebhan -[Romain: rebase on top of 2.26] -Signed-off-by: Romain Naour ---- - ld/ldfile.c | 11 +++++++++-- - 1 file changed, 9 insertions(+), 2 deletions(-) - -diff --git a/ld/ldfile.c b/ld/ldfile.c -index 96f9ecc..1439309 100644 ---- a/ld/ldfile.c -+++ b/ld/ldfile.c -@@ -335,18 +335,25 @@ ldfile_open_file_search (const char *arch, - directory first. */ - if (! entry->flags.maybe_archive) - { -- if (entry->flags.sysrooted && IS_ABSOLUTE_PATH (entry->filename)) -+ /* For absolute pathnames, try to always open the file in the -+ sysroot first. If this fails, try to open the file at the -+ given location. */ -+ entry->flags.sysrooted = is_sysrooted_pathname (entry->filename); -+ if (!entry->flags.sysrooted && IS_ABSOLUTE_PATH (entry->filename) -+ && ld_sysroot) - { - char *name = concat (ld_sysroot, entry->filename, - (const char *) NULL); - if (ldfile_try_open_bfd (name, entry)) - { - entry->filename = name; -+ entry->flags.sysrooted = TRUE; - return TRUE; - } - free (name); - } -- else if (ldfile_try_open_bfd (entry->filename, entry)) -+ -+ if (ldfile_try_open_bfd (entry->filename, entry)) - return TRUE; - - if (IS_ABSOLUTE_PATH (entry->filename)) --- -2.4.3 - diff --git a/bsp/buildroot/package/binutils/2.27/0600-poison-system-directories.patch b/bsp/buildroot/package/binutils/2.27/0600-poison-system-directories.patch deleted file mode 100644 index d16994ec..00000000 --- a/bsp/buildroot/package/binutils/2.27/0600-poison-system-directories.patch +++ /dev/null @@ -1,306 +0,0 @@ -From be366461dd49e760440fb28eaee5164eb281adcc Mon Sep 17 00:00:00 2001 -From: Romain Naour -Date: Fri, 25 Dec 2015 11:45:38 +0100 -Subject: [PATCH] poison-system-directories - -Patch adapted to binutils 2.23.2 and extended to use -BR_COMPILER_PARANOID_UNSAFE_PATH by Thomas Petazzoni. - -[Romain: rebase on top of 2.26] -Signed-off-by: Romain Naour -[Gustavo: adapt to binutils 2.25] -Signed-off-by: Thomas Petazzoni -Signed-off-by: Gustavo Zacarias - -Upstream-Status: Inappropriate [distribution: codesourcery] - -Patch originally created by Mark Hatle, forward-ported to -binutils 2.21 by Scott Garman. - -purpose: warn for uses of system directories when cross linking - -Code Merged from Sourcery G++ binutils 2.19 - 4.4-277 - -2008-07-02 Joseph Myers - - ld/ - * ld.h (args_type): Add error_poison_system_directories. - * ld.texinfo (--error-poison-system-directories): Document. - * ldfile.c (ldfile_add_library_path): Check - command_line.error_poison_system_directories. - * ldmain.c (main): Initialize - command_line.error_poison_system_directories. - * lexsup.c (enum option_values): Add - OPTION_ERROR_POISON_SYSTEM_DIRECTORIES. - (ld_options): Add --error-poison-system-directories. - (parse_args): Handle new option. - -2007-06-13 Joseph Myers - - ld/ - * config.in: Regenerate. - * ld.h (args_type): Add poison_system_directories. - * ld.texinfo (--no-poison-system-directories): Document. - * ldfile.c (ldfile_add_library_path): Check - command_line.poison_system_directories. - * ldmain.c (main): Initialize - command_line.poison_system_directories. - * lexsup.c (enum option_values): Add - OPTION_NO_POISON_SYSTEM_DIRECTORIES. - (ld_options): Add --no-poison-system-directories. - (parse_args): Handle new option. - -2007-04-20 Joseph Myers - - Merge from Sourcery G++ binutils 2.17: - - 2007-03-20 Joseph Myers - Based on patch by Mark Hatle . - ld/ - * configure.ac (--enable-poison-system-directories): New option. - * configure, config.in: Regenerate. - * ldfile.c (ldfile_add_library_path): If - ENABLE_POISON_SYSTEM_DIRECTORIES defined, warn for use of /lib, - /usr/lib, /usr/local/lib or /usr/X11R6/lib. - -Signed-off-by: Mark Hatle -Signed-off-by: Scott Garman ---- - ld/config.in | 3 +++ - ld/configure | 14 ++++++++++++++ - ld/configure.ac | 10 ++++++++++ - ld/ld.h | 8 ++++++++ - ld/ld.texinfo | 12 ++++++++++++ - ld/ldfile.c | 17 +++++++++++++++++ - ld/ldlex.h | 2 ++ - ld/ldmain.c | 2 ++ - ld/lexsup.c | 21 +++++++++++++++++++++ - 9 files changed, 89 insertions(+) - -diff --git a/ld/config.in b/ld/config.in -index 276fb77..35c58eb 100644 ---- a/ld/config.in -+++ b/ld/config.in -@@ -14,6 +14,9 @@ - language is requested. */ - #undef ENABLE_NLS - -+/* Define to warn for use of native system library directories */ -+#undef ENABLE_POISON_SYSTEM_DIRECTORIES -+ - /* Additional extension a shared object might have. */ - #undef EXTRA_SHLIB_EXTENSION - -diff --git a/ld/configure b/ld/configure -index a446283..d1f9504 100755 ---- a/ld/configure -+++ b/ld/configure -@@ -786,6 +786,7 @@ with_lib_path - enable_targets - enable_64_bit_bfd - with_sysroot -+enable_poison_system_directories - enable_gold - enable_got - enable_compressed_debug_sections -@@ -1442,6 +1443,8 @@ Optional Features: - --disable-largefile omit support for large files - --enable-targets alternative target configurations - --enable-64-bit-bfd 64-bit support (on hosts with narrower word sizes) -+ --enable-poison-system-directories -+ warn for use of native system library directories - --enable-gold[=ARG] build gold [ARG={default,yes,no}] - --enable-got= GOT handling scheme (target, single, negative, - multigot) -@@ -15491,7 +15494,18 @@ else - fi - - -+# Check whether --enable-poison-system-directories was given. -+if test "${enable_poison_system_directories+set}" = set; then : -+ enableval=$enable_poison_system_directories; -+else -+ enable_poison_system_directories=no -+fi -+ -+if test "x${enable_poison_system_directories}" = "xyes"; then - -+$as_echo "#define ENABLE_POISON_SYSTEM_DIRECTORIES 1" >>confdefs.h -+ -+fi - - # Check whether --enable-got was given. - if test "${enable_got+set}" = set; then : -diff --git a/ld/configure.ac b/ld/configure.ac -index 188172d..2cd8443 100644 ---- a/ld/configure.ac -+++ b/ld/configure.ac -@@ -95,6 +95,16 @@ AC_SUBST(use_sysroot) - AC_SUBST(TARGET_SYSTEM_ROOT) - AC_SUBST(TARGET_SYSTEM_ROOT_DEFINE) - -+AC_ARG_ENABLE([poison-system-directories], -+ AS_HELP_STRING([--enable-poison-system-directories], -+ [warn for use of native system library directories]),, -+ [enable_poison_system_directories=no]) -+if test "x${enable_poison_system_directories}" = "xyes"; then -+ AC_DEFINE([ENABLE_POISON_SYSTEM_DIRECTORIES], -+ [1], -+ [Define to warn for use of native system library directories]) -+fi -+ - dnl Use --enable-gold to decide if this linker should be the default. - dnl "install_as_default" is set to false if gold is the default linker. - dnl "installed_linker" is the installed BFD linker name. -diff --git a/ld/ld.h b/ld/ld.h -index d84ec4e..3476b26 100644 ---- a/ld/ld.h -+++ b/ld/ld.h -@@ -164,6 +164,14 @@ typedef struct { - /* If set, display the target memory usage (per memory region). */ - bfd_boolean print_memory_usage; - -+ /* If TRUE (the default) warn for uses of system directories when -+ cross linking. */ -+ bfd_boolean poison_system_directories; -+ -+ /* If TRUE (default FALSE) give an error for uses of system -+ directories when cross linking instead of a warning. */ -+ bfd_boolean error_poison_system_directories; -+ - /* Big or little endian as set on command line. */ - enum endian_enum endian; - -diff --git a/ld/ld.texinfo b/ld/ld.texinfo -index 1dd7492..fb1438e 100644 ---- a/ld/ld.texinfo -+++ b/ld/ld.texinfo -@@ -2332,6 +2332,18 @@ string identifying the original linked file does not change. - - Passing @code{none} for @var{style} disables the setting from any - @code{--build-id} options earlier on the command line. -+ -+@kindex --no-poison-system-directories -+@item --no-poison-system-directories -+Do not warn for @option{-L} options using system directories such as -+@file{/usr/lib} when cross linking. This option is intended for use -+in chroot environments when such directories contain the correct -+libraries for the target system rather than the host. -+ -+@kindex --error-poison-system-directories -+@item --error-poison-system-directories -+Give an error instead of a warning for @option{-L} options using -+system directories when cross linking. - @end table - - @c man end -diff --git a/ld/ldfile.c b/ld/ldfile.c -index 1439309..086b354 100644 ---- a/ld/ldfile.c -+++ b/ld/ldfile.c -@@ -114,6 +114,23 @@ ldfile_add_library_path (const char *name, bfd_boolean cmdline) - new_dirs->name = concat (ld_sysroot, name + 1, (const char *) NULL); - else - new_dirs->name = xstrdup (name); -+ -+#ifdef ENABLE_POISON_SYSTEM_DIRECTORIES -+ if (command_line.poison_system_directories -+ && ((!strncmp (name, "/lib", 4)) -+ || (!strncmp (name, "/usr/lib", 8)) -+ || (!strncmp (name, "/usr/local/lib", 14)) -+ || (!strncmp (name, "/usr/X11R6/lib", 14)))) -+ { -+ if (command_line.error_poison_system_directories) -+ einfo (_("%X%P: error: library search path \"%s\" is unsafe for " -+ "cross-compilation\n"), name); -+ else -+ einfo (_("%P: warning: library search path \"%s\" is unsafe for " -+ "cross-compilation\n"), name); -+ } -+#endif -+ - } - - /* Try to open a BFD for a lang_input_statement. */ -diff --git a/ld/ldlex.h b/ld/ldlex.h -index 6f11e7b..0ca3110 100644 ---- a/ld/ldlex.h -+++ b/ld/ldlex.h -@@ -144,6 +144,8 @@ enum option_values - OPTION_PRINT_MEMORY_USAGE, - OPTION_REQUIRE_DEFINED_SYMBOL, - OPTION_ORPHAN_HANDLING, -+ OPTION_NO_POISON_SYSTEM_DIRECTORIES, -+ OPTION_ERROR_POISON_SYSTEM_DIRECTORIES, - }; - - /* The initial parser states. */ -diff --git a/ld/ldmain.c b/ld/ldmain.c -index bb0b9cc..a23c56c 100644 ---- a/ld/ldmain.c -+++ b/ld/ldmain.c -@@ -257,6 +257,8 @@ main (int argc, char **argv) - command_line.warn_mismatch = TRUE; - command_line.warn_search_mismatch = TRUE; - command_line.check_section_addresses = -1; -+ command_line.poison_system_directories = TRUE; -+ command_line.error_poison_system_directories = FALSE; - - /* We initialize DEMANGLING based on the environment variable - COLLECT_NO_DEMANGLE. The gcc collect2 program will demangle the -diff --git a/ld/lexsup.c b/ld/lexsup.c -index 4cad209..be7d584 100644 ---- a/ld/lexsup.c -+++ b/ld/lexsup.c -@@ -530,6 +530,14 @@ static const struct ld_option ld_options[] = - { {"orphan-handling", required_argument, NULL, OPTION_ORPHAN_HANDLING}, - '\0', N_("=MODE"), N_("Control how orphan sections are handled."), - TWO_DASHES }, -+ { {"no-poison-system-directories", no_argument, NULL, -+ OPTION_NO_POISON_SYSTEM_DIRECTORIES}, -+ '\0', NULL, N_("Do not warn for -L options using system directories"), -+ TWO_DASHES }, -+ { {"error-poison-system-directories", no_argument, NULL, -+ OPTION_ERROR_POISON_SYSTEM_DIRECTORIES}, -+ '\0', NULL, N_("Give an error for -L options using system directories"), -+ TWO_DASHES }, - }; - - #define OPTION_COUNT ARRAY_SIZE (ld_options) -@@ -542,6 +550,7 @@ parse_args (unsigned argc, char **argv) - int ingroup = 0; - char *default_dirlist = NULL; - char *shortopts; -+ char *BR_paranoid_env; - struct option *longopts; - struct option *really_longopts; - int last_optind; -@@ -1516,6 +1525,14 @@ parse_args (unsigned argc, char **argv) - } - break; - -+ case OPTION_NO_POISON_SYSTEM_DIRECTORIES: -+ command_line.poison_system_directories = FALSE; -+ break; -+ -+ case OPTION_ERROR_POISON_SYSTEM_DIRECTORIES: -+ command_line.error_poison_system_directories = TRUE; -+ break; -+ - case OPTION_PUSH_STATE: - input_flags.pushed = xmemdup (&input_flags, - sizeof (input_flags), -@@ -1559,6 +1576,10 @@ parse_args (unsigned argc, char **argv) - command_line.soname = NULL; - } - -+ BR_paranoid_env = getenv("BR_COMPILER_PARANOID_UNSAFE_PATH"); -+ if (BR_paranoid_env && strlen(BR_paranoid_env) > 0) -+ command_line.error_poison_system_directories = TRUE; -+ - while (ingroup) - { - lang_leave_group (); --- -2.4.3 - diff --git a/bsp/buildroot/package/binutils/2.27/0900-Revert-part-Set-dynamic-tag-VMA-and-size-from-dynami.patch b/bsp/buildroot/package/binutils/2.27/0900-Revert-part-Set-dynamic-tag-VMA-and-size-from-dynami.patch deleted file mode 100644 index f1ec2599..00000000 --- a/bsp/buildroot/package/binutils/2.27/0900-Revert-part-Set-dynamic-tag-VMA-and-size-from-dynami.patch +++ /dev/null @@ -1,36 +0,0 @@ -From c646b02fdcae5f37bd88f33a0c4683ef13ad5c82 Mon Sep 17 00:00:00 2001 -From: Alan Modra -Date: Mon, 31 Oct 2016 12:46:38 +1030 -Subject: [PATCH] Revert part "Set dynamic tag VMA and size from dynamic - section when possible" - - PR 20748 - * elf32-microblaze.c (microblaze_elf_finish_dynamic_sections): Revert - 2016-05-13 change. - -Signed-off-by: Alan Modra -Signed-off-by: Waldemar Brodkorb - -diff --git a/bfd/elf32-microblaze.c b/bfd/elf32-microblaze.c -index 477e7b3..5c66808 100644 ---- a/bfd/elf32-microblaze.c -+++ b/bfd/elf32-microblaze.c -@@ -3396,13 +3396,13 @@ microblaze_elf_finish_dynamic_sections (bfd *output_bfd, - { - asection *s; - -- s = bfd_get_linker_section (dynobj, name); -+ s = bfd_get_section_by_name (output_bfd, name); - if (s == NULL) - dyn.d_un.d_val = 0; - else - { - if (! size) -- dyn.d_un.d_ptr = s->output_section->vma + s->output_offset; -+ dyn.d_un.d_ptr = s->vma; - else - dyn.d_un.d_val = s->size; - } --- -2.1.4 - diff --git a/bsp/buildroot/package/binutils/2.27/0906-microblaze-pr21180.patch b/bsp/buildroot/package/binutils/2.27/0906-microblaze-pr21180.patch deleted file mode 100644 index 48e5e14b..00000000 --- a/bsp/buildroot/package/binutils/2.27/0906-microblaze-pr21180.patch +++ /dev/null @@ -1,33 +0,0 @@ -Fix ld segfault for microblaze when --gc-sections is used -Upstream: pending -https://sourceware.org/bugzilla/show_bug.cgi?id=21180 - -Signed-off-by: Waldemar Brodkorb - -diff -Nur binutils-2.27.orig/bfd/elf32-microblaze.c binutils-2.27/bfd/elf32-microblaze.c ---- binutils-2.27.orig/bfd/elf32-microblaze.c 2016-08-03 09:36:50.000000000 +0200 -+++ binutils-2.27/bfd/elf32-microblaze.c 2017-02-23 19:43:12.612313590 +0100 -@@ -3297,13 +3297,20 @@ - || h->dynindx == -1)) - { - asection *sec = h->root.u.def.section; -+ bfd_vma value; -+ -+ value = h->root.u.def.value; -+ if (sec->output_section != NULL) -+ /* PR 21180: If the output section is NULL, then the symbol is no -+ longer needed, and in theory the GOT entry is redundant. But -+ it is too late to change our minds now... */ -+ value += sec->output_section->vma + sec->output_offset; -+ - microblaze_elf_output_dynamic_relocation (output_bfd, - srela, srela->reloc_count++, - /* symindex= */ 0, - R_MICROBLAZE_REL, offset, -- h->root.u.def.value -- + sec->output_section->vma -- + sec->output_offset); -+ value); - } - else - { diff --git a/bsp/buildroot/package/binutils/2.27/0907-Automatically-enable-CRC-instructions-on-supported-A.patch b/bsp/buildroot/package/binutils/2.27/0907-Automatically-enable-CRC-instructions-on-supported-A.patch deleted file mode 100644 index 3b7fcfc9..00000000 --- a/bsp/buildroot/package/binutils/2.27/0907-Automatically-enable-CRC-instructions-on-supported-A.patch +++ /dev/null @@ -1,88 +0,0 @@ -From 29a4659015ca7044c2d425d32a0b828e0fbb5ac1 Mon Sep 17 00:00:00 2001 -From: Richard Earnshaw -Date: Wed, 7 Sep 2016 17:14:54 +0100 -Subject: [PATCH] Automatically enable CRC instructions on supported ARMv8-A - CPUs. - -2016-09-07 Richard Earnshaw - - * opcode/arm.h (ARM_ARCH_V8A_CRC): New architecture. - -2016-09-07 Richard Earnshaw - - * config/tc-arm.c ((arm_cpus): Use ARM_ARCH_V8A_CRC for all - ARMv8-A CPUs except xgene1. - -Upstream: https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;a=patch;h=27e5a270962fb92c07e7d476966ba380fa3bb68e -Signed-off-by: Peter Seiderer ---- - gas/config/tc-arm.c | 18 +++++++++--------- - include/opcode/arm.h | 2 ++ - 2 files changed, 11 insertions(+), 9 deletions(-) - -diff --git a/gas/config/tc-arm.c b/gas/config/tc-arm.c -index 73d05316..7c86184d 100644 ---- a/gas/config/tc-arm.c -+++ b/gas/config/tc-arm.c -@@ -25332,17 +25332,17 @@ static const struct arm_cpu_option_table arm_cpus[] = - "Cortex-A15"), - ARM_CPU_OPT ("cortex-a17", ARM_ARCH_V7VE, FPU_ARCH_NEON_VFP_V4, - "Cortex-A17"), -- ARM_CPU_OPT ("cortex-a32", ARM_ARCH_V8A, FPU_ARCH_CRYPTO_NEON_VFP_ARMV8, -+ ARM_CPU_OPT ("cortex-a32", ARM_ARCH_V8A_CRC, FPU_ARCH_CRYPTO_NEON_VFP_ARMV8, - "Cortex-A32"), -- ARM_CPU_OPT ("cortex-a35", ARM_ARCH_V8A, FPU_ARCH_CRYPTO_NEON_VFP_ARMV8, -+ ARM_CPU_OPT ("cortex-a35", ARM_ARCH_V8A_CRC, FPU_ARCH_CRYPTO_NEON_VFP_ARMV8, - "Cortex-A35"), -- ARM_CPU_OPT ("cortex-a53", ARM_ARCH_V8A, FPU_ARCH_CRYPTO_NEON_VFP_ARMV8, -+ ARM_CPU_OPT ("cortex-a53", ARM_ARCH_V8A_CRC, FPU_ARCH_CRYPTO_NEON_VFP_ARMV8, - "Cortex-A53"), -- ARM_CPU_OPT ("cortex-a57", ARM_ARCH_V8A, FPU_ARCH_CRYPTO_NEON_VFP_ARMV8, -+ ARM_CPU_OPT ("cortex-a57", ARM_ARCH_V8A_CRC, FPU_ARCH_CRYPTO_NEON_VFP_ARMV8, - "Cortex-A57"), -- ARM_CPU_OPT ("cortex-a72", ARM_ARCH_V8A, FPU_ARCH_CRYPTO_NEON_VFP_ARMV8, -+ ARM_CPU_OPT ("cortex-a72", ARM_ARCH_V8A_CRC, FPU_ARCH_CRYPTO_NEON_VFP_ARMV8, - "Cortex-A72"), -- ARM_CPU_OPT ("cortex-a73", ARM_ARCH_V8A, FPU_ARCH_CRYPTO_NEON_VFP_ARMV8, -+ ARM_CPU_OPT ("cortex-a73", ARM_ARCH_V8A_CRC, FPU_ARCH_CRYPTO_NEON_VFP_ARMV8, - "Cortex-A73"), - ARM_CPU_OPT ("cortex-r4", ARM_ARCH_V7R, FPU_NONE, "Cortex-R4"), - ARM_CPU_OPT ("cortex-r4f", ARM_ARCH_V7R, FPU_ARCH_VFP_V3D16, -@@ -25361,10 +25361,10 @@ static const struct arm_cpu_option_table arm_cpus[] = - ARM_CPU_OPT ("cortex-m1", ARM_ARCH_V6SM, FPU_NONE, "Cortex-M1"), - ARM_CPU_OPT ("cortex-m0", ARM_ARCH_V6SM, FPU_NONE, "Cortex-M0"), - ARM_CPU_OPT ("cortex-m0plus", ARM_ARCH_V6SM, FPU_NONE, "Cortex-M0+"), -- ARM_CPU_OPT ("exynos-m1", ARM_ARCH_V8A, FPU_ARCH_CRYPTO_NEON_VFP_ARMV8, -+ ARM_CPU_OPT ("exynos-m1", ARM_ARCH_V8A_CRC, FPU_ARCH_CRYPTO_NEON_VFP_ARMV8, - "Samsung " \ - "Exynos M1"), -- ARM_CPU_OPT ("qdf24xx", ARM_ARCH_V8A, FPU_ARCH_CRYPTO_NEON_VFP_ARMV8, -+ ARM_CPU_OPT ("qdf24xx", ARM_ARCH_V8A_CRC, FPU_ARCH_CRYPTO_NEON_VFP_ARMV8, - "Qualcomm " - "QDF24XX"), - -@@ -25389,7 +25389,7 @@ static const struct arm_cpu_option_table arm_cpus[] = - /* APM X-Gene family. */ - ARM_CPU_OPT ("xgene1", ARM_ARCH_V8A, FPU_ARCH_CRYPTO_NEON_VFP_ARMV8, - "APM X-Gene 1"), -- ARM_CPU_OPT ("xgene2", ARM_ARCH_V8A, FPU_ARCH_CRYPTO_NEON_VFP_ARMV8, -+ ARM_CPU_OPT ("xgene2", ARM_ARCH_V8A_CRC, FPU_ARCH_CRYPTO_NEON_VFP_ARMV8, - "APM X-Gene 2"), - - { NULL, 0, ARM_ARCH_NONE, ARM_ARCH_NONE, NULL } -diff --git a/include/opcode/arm.h b/include/opcode/arm.h -index 60715cf8..feace5cd 100644 ---- a/include/opcode/arm.h -+++ b/include/opcode/arm.h -@@ -263,6 +263,8 @@ - #define ARM_ARCH_V7M ARM_FEATURE_CORE (ARM_AEXT_V7M, ARM_EXT2_V6T2_V8M) - #define ARM_ARCH_V7EM ARM_FEATURE_CORE (ARM_AEXT_V7EM, ARM_EXT2_V6T2_V8M) - #define ARM_ARCH_V8A ARM_FEATURE_CORE (ARM_AEXT_V8A, ARM_AEXT2_V8A) -+#define ARM_ARCH_V8A_CRC ARM_FEATURE (ARM_AEXT_V8A, ARM_AEXT2_V8A, \ -+ CRC_EXT_ARMV8) - #define ARM_ARCH_V8_1A ARM_FEATURE (ARM_AEXT_V8A, ARM_AEXT2_V8_1A, \ - CRC_EXT_ARMV8 | FPU_NEON_EXT_RDMA) - #define ARM_ARCH_V8_2A ARM_FEATURE (ARM_AEXT_V8A, ARM_AEXT2_V8_2A, \ --- -2.11.0 - diff --git a/bsp/buildroot/package/binutils/Config.in.host b/bsp/buildroot/package/binutils/Config.in.host index bc0e223e..99f78fc3 100644 --- a/bsp/buildroot/package/binutils/Config.in.host +++ b/bsp/buildroot/package/binutils/Config.in.host @@ -1,5 +1,11 @@ comment "Binutils Options" +config BR2_PACKAGE_HOST_BINUTILS_SUPPORTS_CFI + bool + default y + depends on !BR2_microblaze + depends on !(BR2_nios2 && (BR2_BINUTILS_VERSION_2_28_X || BR2_BINUTILS_VERSION_2_29_X)) + choice prompt "Binutils Version" default BR2_BINUTILS_VERSION_2_28_X if BR2_ARM_INSTRUCTIONS_THUMB diff --git a/bsp/buildroot/package/brotli/0001-CMake-Allow-using-BUILD_SHARED_LIBS-to-choose-static.patch b/bsp/buildroot/package/brotli/0001-CMake-Allow-using-BUILD_SHARED_LIBS-to-choose-static.patch index 33b9bb70..ae5386b1 100644 --- a/bsp/buildroot/package/brotli/0001-CMake-Allow-using-BUILD_SHARED_LIBS-to-choose-static.patch +++ b/bsp/buildroot/package/brotli/0001-CMake-Allow-using-BUILD_SHARED_LIBS-to-choose-static.patch @@ -1,4 +1,4 @@ -From b60b613e7c2c9bf7a142c3c486ac6e77ad93f5d1 Mon Sep 17 00:00:00 2001 +From 7289e5a378ba13801996a84d89d8fe95c3fc4c11 Mon Sep 17 00:00:00 2001 From: Adrian Perez de Castro Date: Mon, 26 Mar 2018 19:08:31 +0100 Subject: [PATCH] CMake: Allow using BUILD_SHARED_LIBS to choose static/shared @@ -27,7 +27,7 @@ Signed-off-by: Adrian Perez de Castro Upstream-Status: Submitted [https://github.com/google/brotli/pull/655] diff --git a/CMakeLists.txt b/CMakeLists.txt -index 99b9258..3867931 100644 +index fc45f80..3f87f13 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -6,6 +6,8 @@ cmake_minimum_required(VERSION 2.8.6) @@ -120,25 +120,25 @@ index 99b9258..3867931 100644 DIRECTORY ${BROTLI_INCLUDE_DIRS}/brotli DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}" diff --git a/c/fuzz/test_fuzzer.sh b/c/fuzz/test_fuzzer.sh -index 5c754e1..e85e12f 100755 +index 9985194..4b99947 100755 --- a/c/fuzz/test_fuzzer.sh +++ b/c/fuzz/test_fuzzer.sh -@@ -14,12 +14,12 @@ mkdir bin +@@ -13,12 +13,12 @@ mkdir bin cd bin - cmake $BROTLI -DCMAKE_C_COMPILER="$CC" -DCMAKE_CXX_COMPILER="$CXX" \ + cmake $BROTLI -DCMAKE_C_COMPILER="$CC" \ - -DBUILD_TESTING=OFF -DENABLE_SANITIZER=address -make -j$(nproc) brotlidec-static + -DBUILD_TESTING=OFF -DBUILD_SHARED_LIBS=OFF -DENABLE_SANITIZER=address +make -j$(nproc) brotlidec - ${CXX} -o run_decode_fuzzer -std=c++11 -fsanitize=address -I$SRC/include \ - $SRC/fuzz/decode_fuzzer.cc $SRC/fuzz/run_decode_fuzzer.cc \ + ${CC} -o run_decode_fuzzer -std=c99 -fsanitize=address -I$SRC/include \ + $SRC/fuzz/decode_fuzzer.c $SRC/fuzz/run_decode_fuzzer.c \ - ./libbrotlidec-static.a ./libbrotlicommon-static.a + ./libbrotlidec.a ./libbrotlicommon.a mkdir decode_corpora unzip $BROTLI/java/org/brotli/integration/fuzz_data.zip -d decode_corpora -- -2.16.3 +2.19.1 diff --git a/bsp/buildroot/package/brotli/0001-Tell-CMake-to-not-check-for-a-C-compiler.patch b/bsp/buildroot/package/brotli/0001-Tell-CMake-to-not-check-for-a-C-compiler.patch deleted file mode 100644 index 410de283..00000000 --- a/bsp/buildroot/package/brotli/0001-Tell-CMake-to-not-check-for-a-C-compiler.patch +++ /dev/null @@ -1,31 +0,0 @@ -From fea0b1e46c486225d57e730cc0f94fa06b5b93fc Mon Sep 17 00:00:00 2001 -From: Adrian Perez de Castro -Date: Mon, 26 Mar 2018 12:12:00 +0100 -Subject: [PATCH] Tell CMake to not check for a C++ compiler - -By default CMake checks both for C and C++ compilers, while the latter -is not needed. Setting the list of languages to just "C" in the call to -project() removes the unneeded check. ---- - CMakeLists.txt | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -Signed-off-by: Adrian Perez de Castro -Upstream-Status: Submitted [https://github.com/google/brotli/pull/653] - -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 2dc7232..3fbcbfb 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -4,7 +4,7 @@ - # support 2.8.7. - cmake_minimum_required(VERSION 2.8.6) - --project(brotli) -+project(brotli LANGUAGES C) - - # If Brotli is being bundled in another project, we don't want to - # install anything. However, we want to let people override this, so --- -2.16.3 - diff --git a/bsp/buildroot/package/brotli/brotli.hash b/bsp/buildroot/package/brotli/brotli.hash index 954d44eb..82163040 100644 --- a/bsp/buildroot/package/brotli/brotli.hash +++ b/bsp/buildroot/package/brotli/brotli.hash @@ -1,5 +1,5 @@ # Locally generated: -sha512 93adcf437d730ac403e444285ac8aefbb2c8a6b5e1b064e8ee33684c067287a8159e0ee73d2217c167881e87da73fa494792d963a15508fd42b2ac4a5b52823c v1.0.3.tar.gz +sha512 a82362aa36d2f2094bca0b2808d9de0d57291fb3a4c29d7c0ca0a37e73087ec5ac4df299c8c363e61106fccf2fe7f58b5cf76eb97729e2696058ef43b1d3930a v1.0.7.tar.gz # Hash for license files: sha512 bae78184c2f50f86d8c727826d3982c469454c42b9af81f4ef007e39036434fa894cf5be3bf5fc65b7de2301f0a72d067a8186e303327db8a96bd14867e0a3a8 LICENSE diff --git a/bsp/buildroot/package/brotli/brotli.mk b/bsp/buildroot/package/brotli/brotli.mk index cf1e8115..2c1ad487 100644 --- a/bsp/buildroot/package/brotli/brotli.mk +++ b/bsp/buildroot/package/brotli/brotli.mk @@ -4,7 +4,7 @@ # ################################################################################ -BROTLI_VERSION = 1.0.3 +BROTLI_VERSION = 1.0.7 BROTLI_SOURCE = v$(BROTLI_VERSION).tar.gz BROTLI_SITE = https://github.com/google/brotli/archive BROTLI_LICENSE = MIT diff --git a/bsp/buildroot/package/ca-certificates/ca-certificates.mk b/bsp/buildroot/package/ca-certificates/ca-certificates.mk index cb0e9614..515a4f21 100644 --- a/bsp/buildroot/package/ca-certificates/ca-certificates.mk +++ b/bsp/buildroot/package/ca-certificates/ca-certificates.mk @@ -16,7 +16,7 @@ CA_CERTIFICATES_LICENSE = GPL-2.0+ (script), MPL-2.0 (data) CA_CERTIFICATES_LICENSE_FILES = debian/copyright define CA_CERTIFICATES_BUILD_CMDS - $(TARGET_MAKE_ENV) $(MAKE) -C $(@D) all + $(TARGET_MAKE_ENV) $(MAKE) -C $(@D) clean all endef define CA_CERTIFICATES_INSTALL_TARGET_CMDS @@ -31,13 +31,17 @@ define CA_CERTIFICATES_INSTALL_TARGET_CMDS # Create symlinks to certificates under /etc/ssl/certs # and generate the bundle cd $(TARGET_DIR) ;\ - for i in `find usr/share/ca-certificates -name "*.crt"` ; do \ + for i in `find usr/share/ca-certificates -name "*.crt" | LC_COLLATE=C sort` ; do \ ln -sf ../../../$$i etc/ssl/certs/`basename $${i} .crt`.pem ;\ - cat $$i >>etc/ssl/certs/ca-certificates.crt ;\ - done + cat $$i ;\ + done >$(@D)/ca-certificates.crt # Create symlinks to the certificates by their hash values $(HOST_DIR)/bin/c_rehash $(TARGET_DIR)/etc/ssl/certs + + # Install the certificates bundle + $(INSTALL) -D -m 644 $(@D)/ca-certificates.crt \ + $(TARGET_DIR)/etc/ssl/certs/ca-certificates.crt endef $(eval $(generic-package)) diff --git a/bsp/buildroot/package/cups-filters/cups-filters.mk b/bsp/buildroot/package/cups-filters/cups-filters.mk index 131e5824..3c5e13da 100644 --- a/bsp/buildroot/package/cups-filters/cups-filters.mk +++ b/bsp/buildroot/package/cups-filters/cups-filters.mk @@ -8,7 +8,8 @@ CUPS_FILTERS_VERSION = 1.20.3 CUPS_FILTERS_SITE = http://openprinting.org/download/cups-filters CUPS_FILTERS_LICENSE = GPL-2.0, GPL-2.0+, GPL-3.0, GPL-3.0+, LGPL-2, LGPL-2.1+, MIT, BSD-4-Clause CUPS_FILTERS_LICENSE_FILES = COPYING - +# 0001-Replace-relative-linking-with-absolute-linking.patch +CUPS_FILTERS_AUTORECONF = YES CUPS_FILTERS_DEPENDENCIES = cups libglib2 lcms2 qpdf fontconfig freetype jpeg CUPS_FILTERS_CONF_OPTS = --disable-imagefilters \ diff --git a/bsp/buildroot/package/easydbus/0001-easydbus-is-a-C-project-file.patch b/bsp/buildroot/package/easydbus/0001-easydbus-is-a-C-project-file.patch new file mode 100644 index 00000000..1c149c58 --- /dev/null +++ b/bsp/buildroot/package/easydbus/0001-easydbus-is-a-C-project-file.patch @@ -0,0 +1,33 @@ +From a4bd47f593fbe55bd3ab17532e64be74aff5b29d Mon Sep 17 00:00:00 2001 +From: Fabrice Fontaine +Date: Sat, 17 Nov 2018 11:38:05 +0100 +Subject: [PATCH] easydbus is a C project file + +Specify that easydbus is a C project file otherwise build will fail if +no C++ compiler is found by cmake + +Fixes: + - http://autobuild.buildroot.org/results/486c3cd98124e7415dee2fd1463bd5e0fcc9ba91 + +Signed-off-by: Fabrice Fontaine +[Upstream status: https://github.com/mniestroj/easydbus/pull/2] +--- + CMakeLists.txt | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 58ccb2d..575eb24 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -5,7 +5,7 @@ + # + + cmake_minimum_required(VERSION 2.6) +-project(easydbus) ++project(easydbus C) + + add_definitions("-Wall -Wextra -Wno-unused-parameter") + set(CMAKE_C_FLAGS_RELEASE "-O2") +-- +2.17.1 + diff --git a/bsp/buildroot/package/elfutils/0002-disable-progs.patch b/bsp/buildroot/package/elfutils/0001-Add-a-enable-disable-progs-configure-option.patch similarity index 100% rename from bsp/buildroot/package/elfutils/0002-disable-progs.patch rename to bsp/buildroot/package/elfutils/0001-Add-a-enable-disable-progs-configure-option.patch diff --git a/bsp/buildroot/package/elfutils/0003-fts.patch b/bsp/buildroot/package/elfutils/0002-Add-an-implementation-of-the-fts_-functions.patch similarity index 100% rename from bsp/buildroot/package/elfutils/0003-fts.patch rename to bsp/buildroot/package/elfutils/0002-Add-an-implementation-of-the-fts_-functions.patch diff --git a/bsp/buildroot/package/elfutils/0005-really-make-werror-conditional-to-build-werror.patch b/bsp/buildroot/package/elfutils/0003-Really-make-Werror-conditional-to-BUILD_WERROR.patch similarity index 80% rename from bsp/buildroot/package/elfutils/0005-really-make-werror-conditional-to-build-werror.patch rename to bsp/buildroot/package/elfutils/0003-Really-make-Werror-conditional-to-BUILD_WERROR.patch index a7017d6e..21ffa7f3 100644 --- a/bsp/buildroot/package/elfutils/0005-really-make-werror-conditional-to-build-werror.patch +++ b/bsp/buildroot/package/elfutils/0003-Really-make-Werror-conditional-to-BUILD_WERROR.patch @@ -1,4 +1,4 @@ -From 1d8f27d73df6369b19ddd6732960df0d4fdec338 Mon Sep 17 00:00:00 2001 +From 2688a0238eaf825d6659c16c012db0c16f07e197 Mon Sep 17 00:00:00 2001 From: Vicente Olivert Riera Date: Mon, 29 May 2017 23:24:42 +0300 Subject: [PATCH] Really make -Werror conditional to BUILD_WERROR @@ -20,17 +20,17 @@ Signed-off-by: Vicente Olivert Riera 1 file changed, 1 deletion(-) diff --git a/config/eu.am b/config/eu.am -index 8fe1e259f9e2..c5a6209a4e04 100644 +index c2cc349ce876..99b368e09060 100644 --- a/config/eu.am +++ b/config/eu.am -@@ -71,7 +71,6 @@ AM_CFLAGS = -std=gnu99 -Wall -Wshadow -Wformat=2 \ +@@ -73,7 +73,6 @@ AM_CFLAGS = -std=gnu99 -Wall -Wshadow -Wformat=2 \ -Wold-style-definition -Wstrict-prototypes \ $(LOGICAL_OP_WARNING) $(DUPLICATED_COND_WARNING) \ $(NULL_DEREFERENCE_WARNING) $(IMPLICIT_FALLTHROUGH_WARNING) \ - $(if $($(*F)_no_Werror),,-Werror) \ $(if $($(*F)_no_Wunused),,-Wunused -Wextra) \ $(if $($(*F)_no_Wstack_usage),,$(STACK_USAGE_WARNING)) \ - $($(*F)_CFLAGS) + $(if $($(*F)_no_Wpacked_not_aligned),-Wno-packed-not-aligned,) \ -- -2.11.0 +2.17.1 diff --git a/bsp/buildroot/package/elfutils/0004-disable-po.patch b/bsp/buildroot/package/elfutils/0004-disable-po.patch deleted file mode 100644 index c45c5804..00000000 --- a/bsp/buildroot/package/elfutils/0004-disable-po.patch +++ /dev/null @@ -1,24 +0,0 @@ -Disable the build of the po/ directory - -Building the po/ directory complains that the scripts in there have -been generated with gettext 0.17, while we use gettext 0.18 in -Buildroot. Since we don't care that much about po files anyway, just -disable the build of this directory. - -Based on the former patch by Thomas Petazzoni. - -Signed-off-by: Thomas Petazzoni -Signed-off-by: Vicente Olivert Riera - -diff -rup a/Makefile.am b/Makefile.am ---- a/Makefile.am 2014-11-07 15:14:39.018060884 +0000 -+++ b/Makefile.am 2014-11-07 15:30:02.864918229 +0000 -@@ -28,7 +28,7 @@ endif - - # Add doc back when we have some real content. - SUBDIRS = config m4 lib libelf libebl libdwelf libdwfl libdw libcpu libasm \ -- backends $(PROGS_SUBDIR) po tests -+ backends $(PROGS_SUBDIR) tests - - EXTRA_DIST = elfutils.spec GPG-KEY NOTES CONTRIBUTING \ - COPYING COPYING-GPLV2 COPYING-LGPLV3 diff --git a/bsp/buildroot/package/elfutils/0006-memcpy-def.patch b/bsp/buildroot/package/elfutils/0006-memcpy-def.patch deleted file mode 100644 index 50948277..00000000 --- a/bsp/buildroot/package/elfutils/0006-memcpy-def.patch +++ /dev/null @@ -1,26 +0,0 @@ -Provide a compatibility alias __memcpy - -For some reason, libelf uses the internal glibc alias __memcpy, which -doesn't exist in uClibc. Add a manual alias so that the build can -proceed with uClibc. - -Based on the former patch by Thomas Petazzoni. - -Signed-off-by: Thomas Petazzoni -Signed-off-by: Vicente Olivert Riera - -diff -rup a/libelf/libelf.h b/libelf/libelf.h ---- a/libelf/libelf.h 2014-08-27 10:25:17.000000000 +0100 -+++ b/libelf/libelf.h 2014-11-07 15:13:08.743508221 +0000 -@@ -34,6 +34,11 @@ - /* Get the ELF types. */ - #include - -+#ifndef _LIBC -+#ifndef __mempcpy -+#define __mempcpy mempcpy -+#endif -+#endif - - /* Known translation types. */ - typedef enum diff --git a/bsp/buildroot/package/elfutils/elfutils.hash b/bsp/buildroot/package/elfutils/elfutils.hash index 76b6dc64..5a76cd58 100644 --- a/bsp/buildroot/package/elfutils/elfutils.hash +++ b/bsp/buildroot/package/elfutils/elfutils.hash @@ -1,2 +1,6 @@ -# From https://sourceware.org/elfutils/ftp/0.169/sha512.sum -sha512 0a81a20bb2aff533d035d6b76f1403437b2e11bce390db57e34b8c26e4b9b3150346d83dddcbfbbdc58063f046ca3223508dba35c6ce88e375d201e7a777a8b9 elfutils-0.169.tar.bz2 +# From https://sourceware.org/elfutils/ftp/0.174/sha512.sum +sha512 696708309c2a9a076099748809ecdc0490f4a8a842b2efc1aae0d746e7c5a8b203743f5626739eff837216b0c052696516b2821f5d3cc3f2eef86597c96d42df elfutils-0.174.tar.bz2 +# Locally calculated +sha256 8ceb4b9ee5adedde47b31e975c1d90c73ad27b6b165a1dcd80c7c545eb65b903 COPYING +sha256 8177f97513213526df2cf6184d8ff986c675afb514d4e68a404010521b880643 COPYING-GPLV2 +sha256 da7eabb7bafdf7d3ae5e9f223aa5bdc1eece45ac569dc21b3b037520b4464768 COPYING-LGPLV3 diff --git a/bsp/buildroot/package/elfutils/elfutils.mk b/bsp/buildroot/package/elfutils/elfutils.mk index 5570a3b3..2d62017b 100644 --- a/bsp/buildroot/package/elfutils/elfutils.mk +++ b/bsp/buildroot/package/elfutils/elfutils.mk @@ -4,12 +4,12 @@ # ################################################################################ -ELFUTILS_VERSION = 0.169 +ELFUTILS_VERSION = 0.174 ELFUTILS_SOURCE = elfutils-$(ELFUTILS_VERSION).tar.bz2 ELFUTILS_SITE = https://sourceware.org/elfutils/ftp/$(ELFUTILS_VERSION) ELFUTILS_INSTALL_STAGING = YES ELFUTILS_LICENSE = GPL-2.0+ or LGPL-3.0+ (library) -ELFUTILS_LICENSE_FILES = COPYING-GPLV2 COPYING-LGPLV3 +ELFUTILS_LICENSE_FILES = COPYING COPYING-GPLV2 COPYING-LGPLV3 ELFUTILS_DEPENDENCIES = zlib $(TARGET_NLS_DEPENDENCIES) HOST_ELFUTILS_DEPENDENCIES = host-zlib host-bzip2 host-xz diff --git a/bsp/buildroot/package/erlang/Config.in b/bsp/buildroot/package/erlang/Config.in index bf745555..00e8ab14 100644 --- a/bsp/buildroot/package/erlang/Config.in +++ b/bsp/buildroot/package/erlang/Config.in @@ -22,6 +22,7 @@ config BR2_PACKAGE_ERLANG depends on BR2_USE_MMU # fork() depends on !BR2_STATIC_LIBS depends on BR2_PACKAGE_ERLANG_ARCH_SUPPORTS + select BR2_PACKAGE_ZLIB help Erlang is a programming language used to build massively scalable soft real-time systems with requirements on high diff --git a/bsp/buildroot/package/erlang/erlang.mk b/bsp/buildroot/package/erlang/erlang.mk index b7fdb6b9..a7d71680 100644 --- a/bsp/buildroot/package/erlang/erlang.mk +++ b/bsp/buildroot/package/erlang/erlang.mk @@ -69,10 +69,9 @@ else ERLANG_CONF_OPTS += --without-odbc endif -ifeq ($(BR2_PACKAGE_ZLIB),y) +# Always use Buildroot's zlib ERLANG_CONF_OPTS += --enable-shared-zlib ERLANG_DEPENDENCIES += zlib -endif # Remove source, example, gs and wx files from staging and target. ERLANG_REMOVE_PACKAGES = gs wx diff --git a/bsp/buildroot/package/file/file.mk b/bsp/buildroot/package/file/file.mk index 422e29b1..1f04dad6 100644 --- a/bsp/buildroot/package/file/file.mk +++ b/bsp/buildroot/package/file/file.mk @@ -12,6 +12,7 @@ FILE_CONF_ENV = ac_cv_prog_cc_c99='-std=gnu99' FILE_INSTALL_STAGING = YES FILE_LICENSE = BSD-2-Clause, BSD-4-Clause (one file), BSD-3-Clause (one file) FILE_LICENSE_FILES = COPYING src/mygetopt.h src/vasprintf.c +HOST_FILE_CONF_OPTS = --disable-libseccomp ifeq ($(BR2_PACKAGE_LIBSECCOMP),y) FILE_CONF_OPTS += --enable-libseccomp diff --git a/bsp/buildroot/package/freetype/freetype.mk b/bsp/buildroot/package/freetype/freetype.mk index 10286647..e755c823 100644 --- a/bsp/buildroot/package/freetype/freetype.mk +++ b/bsp/buildroot/package/freetype/freetype.mk @@ -17,19 +17,6 @@ FREETYPE_CONFIG_SCRIPTS = freetype-config HOST_FREETYPE_DEPENDENCIES = host-pkgconf HOST_FREETYPE_CONF_OPTS = --without-zlib --without-bzip2 --without-png -# Regen required because the tarball ships with an experimental ltmain.sh -# that can't be patched by our infra. -# autogen.sh is because autotools stuff lives in other directories and -# even AUTORECONF with _OPTS doesn't do it properly. -# POST_PATCH is because we still need to patch libtool after the regen. -define FREETYPE_RUN_AUTOGEN - cd $(@D) && PATH=$(BR_PATH) ./autogen.sh -endef -FREETYPE_POST_PATCH_HOOKS += FREETYPE_RUN_AUTOGEN -HOST_FREETYPE_POST_PATCH_HOOKS += FREETYPE_RUN_AUTOGEN -FREETYPE_DEPENDENCIES += host-automake host-autoconf host-libtool -HOST_FREETYPE_DEPENDENCIES += host-automake host-autoconf host-libtool - ifeq ($(BR2_PACKAGE_ZLIB),y) FREETYPE_DEPENDENCIES += zlib FREETYPE_CONF_OPTS += --with-zlib @@ -72,8 +59,3 @@ FREETYPE_POST_INSTALL_STAGING_HOOKS += FREETYPE_FIX_CONFIG_FILE_LIBS $(eval $(autotools-package)) $(eval $(host-autotools-package)) - -# freetype-patch and host-freetype-patch use autogen.sh so add -# host-automake as a order-only-prerequisite because it is a phony -# target. -$(FREETYPE_TARGET_PATCH) $(HOST_FREETYPE_TARGET_PATCH): | host-automake diff --git a/bsp/buildroot/package/gauche/0004-rfc-needs-srfi.patch b/bsp/buildroot/package/gauche/0004-rfc-needs-srfi.patch new file mode 100644 index 00000000..8b83b787 --- /dev/null +++ b/bsp/buildroot/package/gauche/0004-rfc-needs-srfi.patch @@ -0,0 +1,35 @@ +From 33ba5e73ec09f1308f897128334e955debd9ea43 Mon Sep 17 00:00:00 2001 +From: Fabrice Fontaine +Date: Wed, 21 Nov 2018 08:58:25 +0100 +Subject: [PATCH] rfc: needs srfi + +ext/rfc needs srfi-19 since version 0.9.5 and +https://github.com/shirok/Gauche/commit/bd22bc82361c5eeb5d3b58c3836236566746bb96 + +So add a dependency on srfi for rfc target in Makefile.in + +Fixes: + - http://autobuild.buildroot.org/results/f4935e29ce6aaebdaa47d46c56120b7e97145d1b + +Signed-off-by: Fabrice Fontaine +[Upstream status: https://github.com/shirok/Gauche/pull/397] +--- + ext/Makefile.in | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/ext/Makefile.in b/ext/Makefile.in +index 57ddf457e..de8d59a4d 100644 +--- a/ext/Makefile.in ++++ b/ext/Makefile.in +@@ -54,7 +54,7 @@ bcrypt: mt-random + + dbm : threads + +-rfc: gauche util ++rfc: gauche srfi util + + test : check + +-- +2.14.1 + diff --git a/bsp/buildroot/package/gcc/6.4.0/0004-gcc-xtensa-don-t-force-PIC-for-uclinux-target.patch b/bsp/buildroot/package/gcc/6.4.0/0004-gcc-xtensa-don-t-force-PIC-for-uclinux-target.patch new file mode 100644 index 00000000..360947cb --- /dev/null +++ b/bsp/buildroot/package/gcc/6.4.0/0004-gcc-xtensa-don-t-force-PIC-for-uclinux-target.patch @@ -0,0 +1,41 @@ +From 960a2552f7b418134cdf7a31e96023a3811b98dd Mon Sep 17 00:00:00 2001 +From: Max Filippov +Date: Sun, 4 Nov 2018 23:55:59 -0800 +Subject: [PATCH] gcc: xtensa: don't force PIC for uclinux target + +xtensa-uclinux uses bFLT executable file format that cannot relocate +fields representing offsets from data to code. C++ objects built as PIC +use offsets to encode FDE structures. As a result C++ exception handling +doesn't work correctly on xtensa-uclinux. Don't use PIC by default on +xtensa-uclinux. + +gcc/ +2018-11-05 Max Filippov + + * config/xtensa/uclinux.h (XTENSA_ALWAYS_PIC): Change to 0. + +Signed-off-by: Max Filippov +--- +Backported from: r265823 + + gcc/config/xtensa/uclinux.h | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/gcc/config/xtensa/uclinux.h b/gcc/config/xtensa/uclinux.h +index ba26187c8f7a..c7743df9d97c 100644 +--- a/gcc/config/xtensa/uclinux.h ++++ b/gcc/config/xtensa/uclinux.h +@@ -59,8 +59,8 @@ along with GCC; see the file COPYING3. If not see + #undef LOCAL_LABEL_PREFIX + #define LOCAL_LABEL_PREFIX "." + +-/* Always enable "-fpic" for Xtensa Linux. */ +-#define XTENSA_ALWAYS_PIC 1 ++/* Don't enable "-fpic" for Xtensa uclinux. */ ++#define XTENSA_ALWAYS_PIC 0 + + #undef TARGET_LIBC_HAS_FUNCTION + #define TARGET_LIBC_HAS_FUNCTION no_c99_libc_has_function +-- +2.11.0 + diff --git a/bsp/buildroot/package/gcc/7.3.0/0005-gcc-xtensa-don-t-force-PIC-for-uclinux-target.patch b/bsp/buildroot/package/gcc/7.3.0/0005-gcc-xtensa-don-t-force-PIC-for-uclinux-target.patch new file mode 100644 index 00000000..360947cb --- /dev/null +++ b/bsp/buildroot/package/gcc/7.3.0/0005-gcc-xtensa-don-t-force-PIC-for-uclinux-target.patch @@ -0,0 +1,41 @@ +From 960a2552f7b418134cdf7a31e96023a3811b98dd Mon Sep 17 00:00:00 2001 +From: Max Filippov +Date: Sun, 4 Nov 2018 23:55:59 -0800 +Subject: [PATCH] gcc: xtensa: don't force PIC for uclinux target + +xtensa-uclinux uses bFLT executable file format that cannot relocate +fields representing offsets from data to code. C++ objects built as PIC +use offsets to encode FDE structures. As a result C++ exception handling +doesn't work correctly on xtensa-uclinux. Don't use PIC by default on +xtensa-uclinux. + +gcc/ +2018-11-05 Max Filippov + + * config/xtensa/uclinux.h (XTENSA_ALWAYS_PIC): Change to 0. + +Signed-off-by: Max Filippov +--- +Backported from: r265823 + + gcc/config/xtensa/uclinux.h | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/gcc/config/xtensa/uclinux.h b/gcc/config/xtensa/uclinux.h +index ba26187c8f7a..c7743df9d97c 100644 +--- a/gcc/config/xtensa/uclinux.h ++++ b/gcc/config/xtensa/uclinux.h +@@ -59,8 +59,8 @@ along with GCC; see the file COPYING3. If not see + #undef LOCAL_LABEL_PREFIX + #define LOCAL_LABEL_PREFIX "." + +-/* Always enable "-fpic" for Xtensa Linux. */ +-#define XTENSA_ALWAYS_PIC 1 ++/* Don't enable "-fpic" for Xtensa uclinux. */ ++#define XTENSA_ALWAYS_PIC 0 + + #undef TARGET_LIBC_HAS_FUNCTION + #define TARGET_LIBC_HAS_FUNCTION no_c99_libc_has_function +-- +2.11.0 + diff --git a/bsp/buildroot/package/gcc/gcc-final/gcc-final.mk b/bsp/buildroot/package/gcc/gcc-final/gcc-final.mk index 213f3d7b..c27376ad 100644 --- a/bsp/buildroot/package/gcc/gcc-final/gcc-final.mk +++ b/bsp/buildroot/package/gcc/gcc-final/gcc-final.mk @@ -83,6 +83,11 @@ ifeq ($(BR2_sparc),y) HOST_GCC_FINAL_CONF_OPTS += --disable-libcilkrts endif +# Pthreads are required to build libcilkrts +ifeq ($(BR2_PTHREADS_NONE),y) +HOST_GCC_FINAL_CONF_OPTS += --disable-libcilkrts +endif + # Disable shared libs like libstdc++ if we do static since it confuses linking # In that case also disable libcilkrts as there is no static version ifeq ($(BR2_STATIC_LIBS),y) diff --git a/bsp/buildroot/package/giflib/giflib.mk b/bsp/buildroot/package/giflib/giflib.mk index c1471de4..29666eeb 100644 --- a/bsp/buildroot/package/giflib/giflib.mk +++ b/bsp/buildroot/package/giflib/giflib.mk @@ -18,6 +18,8 @@ GIFLIB_BINS = \ gifrsize gifspnge giftext giftool gifwedge icon2gif raw2gif rgb2gif \ text2gif +GIFLIB_CONF_ENV = ac_cv_prog_have_xmlto=no + define GIFLIB_BINS_CLEANUP rm -f $(addprefix $(TARGET_DIR)/usr/bin/,$(GIFLIB_BINS)) endef diff --git a/bsp/buildroot/package/git/git.hash b/bsp/buildroot/package/git/git.hash index 4bcc5ee5..35c8774d 100644 --- a/bsp/buildroot/package/git/git.hash +++ b/bsp/buildroot/package/git/git.hash @@ -1,4 +1,4 @@ # From: https://www.kernel.org/pub/software/scm/git/sha256sums.asc -sha256 6e69b0e9c487e5da52a14d4829f0b6a28b2c18a0bb6fb67c0dc8b5b5658bd532 git-2.16.4.tar.xz +sha256 dfb71b053cbc38a9c5b08c2fe8b5eae210b4e3b63892426923e10cfd6ba63862 git-2.16.5.tar.xz sha256 5b2198d1645f767585e8a88ac0499b04472164c0d2da22e75ecf97ef443ab32e COPYING sha256 1922f45d2c49e390032c9c0ba6d7cac904087f7cec51af30c2b2ad022ce0e76a LGPL-2.1 diff --git a/bsp/buildroot/package/git/git.mk b/bsp/buildroot/package/git/git.mk index ac7b8f2e..9b176d36 100644 --- a/bsp/buildroot/package/git/git.mk +++ b/bsp/buildroot/package/git/git.mk @@ -4,7 +4,7 @@ # ################################################################################ -GIT_VERSION = 2.16.4 +GIT_VERSION = 2.16.5 GIT_SOURCE = git-$(GIT_VERSION).tar.xz GIT_SITE = $(BR2_KERNEL_MIRROR)/software/scm/git GIT_LICENSE = GPL-2.0, LGPL-2.1+ diff --git a/bsp/buildroot/package/glibc/Config.in b/bsp/buildroot/package/glibc/Config.in index 57a2e833..78212510 100644 --- a/bsp/buildroot/package/glibc/Config.in +++ b/bsp/buildroot/package/glibc/Config.in @@ -4,6 +4,7 @@ config BR2_PACKAGE_GLIBC bool default y select BR2_PACKAGE_LINUX_HEADERS - select BR2_TOOLCHAIN_HAS_SSP - + select BR2_TOOLCHAIN_HAS_SSP if BR2_PACKAGE_HOST_BINUTILS_SUPPORTS_CFI + help + https://www.gnu.org/software/libc/ endif diff --git a/bsp/buildroot/package/gpsd/gpsd.mk b/bsp/buildroot/package/gpsd/gpsd.mk index 8c8023e8..e734d222 100644 --- a/bsp/buildroot/package/gpsd/gpsd.mk +++ b/bsp/buildroot/package/gpsd/gpsd.mk @@ -19,6 +19,7 @@ GPSD_SCONS_ENV = $(TARGET_CONFIGURE_OPTS) GPSD_SCONS_OPTS = \ arch=$(ARCH)\ + manbuild=no \ prefix=/usr\ sysroot=$(STAGING_DIR)\ strip=no\ diff --git a/bsp/buildroot/package/gvfs/gvfs.mk b/bsp/buildroot/package/gvfs/gvfs.mk index 7110e390..e272d5c1 100644 --- a/bsp/buildroot/package/gvfs/gvfs.mk +++ b/bsp/buildroot/package/gvfs/gvfs.mk @@ -95,8 +95,8 @@ else GVFS_CONF_OPTS += --disable-nfs endif -ifeq ($(BR2_PACKAGE_LIBSOUP),y) -GVFS_DEPENDENCIES += libsoup +ifeq ($(BR2_PACKAGE_LIBSOUP)$(BR2_PACKAGE_LIBXML2),yy) +GVFS_DEPENDENCIES += libsoup libxml2 GVFS_CONF_OPTS += --enable-http else GVFS_CONF_OPTS += --disable-http diff --git a/bsp/buildroot/package/jasper/jasper.hash b/bsp/buildroot/package/jasper/jasper.hash index b2b82178..8c4f2453 100644 --- a/bsp/buildroot/package/jasper/jasper.hash +++ b/bsp/buildroot/package/jasper/jasper.hash @@ -1,2 +1,3 @@ # Locally calculated sha256 b50413b41bfc82ae419298b41eadcde1aa31f362fb9dc2ac089e5cbc19f60c24 jasper-version-2.0.13.tar.gz +sha256 4ad1bb42aff888c4403d792e6e2c5f1716d6c279fea70b296333c9d577d30b81 LICENSE diff --git a/bsp/buildroot/package/jasper/jasper.mk b/bsp/buildroot/package/jasper/jasper.mk index 2aa3f9d5..9dc46b18 100644 --- a/bsp/buildroot/package/jasper/jasper.mk +++ b/bsp/buildroot/package/jasper/jasper.mk @@ -7,7 +7,7 @@ JASPER_VERSION = version-2.0.13 JASPER_SITE = $(call github,mdadams,jasper,$(JASPER_VERSION)) JASPER_INSTALL_STAGING = YES -JASPER_LICENSE = JasPer License Version 2.0 +JASPER_LICENSE = JasPer-2.0 JASPER_LICENSE_FILES = LICENSE JASPER_SUPPORTS_IN_SOURCE_BUILD = NO JASPER_CONF_OPTS = \ diff --git a/bsp/buildroot/package/lcdproc/lcdproc.mk b/bsp/buildroot/package/lcdproc/lcdproc.mk index e5b6172b..96e59da4 100644 --- a/bsp/buildroot/package/lcdproc/lcdproc.mk +++ b/bsp/buildroot/package/lcdproc/lcdproc.mk @@ -18,7 +18,9 @@ endif LCDPROC_DEPENDENCIES = freetype ncurses zlib -LCDPROC_CONF_ENV += ac_cv_path_FT2_CONFIG=$(STAGING_DIR)/usr/bin/freetype-config +LCDPROC_CONF_ENV += \ + ac_cv_mtab_file=/etc/mtab \ + ac_cv_path_FT2_CONFIG=$(STAGING_DIR)/usr/bin/freetype-config ifeq ($(BR2_PACKAGE_LIBPNG),y) LCDPROC_DEPENDENCIES += libpng diff --git a/bsp/buildroot/package/leveldb/0003-fix-parallel-build.patch b/bsp/buildroot/package/leveldb/0003-fix-parallel-build.patch new file mode 100644 index 00000000..8aafbc2e --- /dev/null +++ b/bsp/buildroot/package/leveldb/0003-fix-parallel-build.patch @@ -0,0 +1,36 @@ +From 293e1b08317567b2e479d24530986676ae4d2221 Mon Sep 17 00:00:00 2001 +From: Fabrice Fontaine +Date: Mon, 8 Oct 2018 23:08:19 +0200 +Subject: [PATCH] fix parallel build + +Build of leveldb sometimes fails on: +Fatal error: can't create out-shared/db/db_bench.o: No such file or directory + +Fix this, by creating $(SHARED_OUTDIR) before building +(SHARED_OUTDIR)/db/db_bench.o + +Fixes: + - http://autobuild.buildroot.net/results/945bb8096c1f98f307161a6def5a9f7f25b2454a + +Signed-off-by: Fabrice Fontaine +[Upstream status: not upstreamable as upstream switched to cmake] +--- + Makefile | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/Makefile b/Makefile +index f7cc7d7..edb56a5 100644 +--- a/Makefile ++++ b/Makefile +@@ -386,7 +386,7 @@ $(STATIC_OUTDIR)/write_batch_test:db/write_batch_test.cc $(STATIC_LIBOBJECTS) $( + $(STATIC_OUTDIR)/memenv_test:$(STATIC_OUTDIR)/helpers/memenv/memenv_test.o $(STATIC_OUTDIR)/libmemenv.a $(STATIC_OUTDIR)/libleveldb.a $(TESTHARNESS) + $(XCRUN) $(CXX) $(LDFLAGS) $(STATIC_OUTDIR)/helpers/memenv/memenv_test.o $(STATIC_OUTDIR)/libmemenv.a $(STATIC_OUTDIR)/libleveldb.a $(TESTHARNESS) -o $@ $(LIBS) + +-$(SHARED_OUTDIR)/db_bench:$(SHARED_OUTDIR)/db/db_bench.o $(SHARED_LIBS) $(TESTUTIL) ++$(SHARED_OUTDIR)/db_bench:$(SHARED_OUTDIR) $(SHARED_OUTDIR)/db/db_bench.o $(SHARED_LIBS) $(TESTUTIL) + $(XCRUN) $(CXX) $(LDFLAGS) $(CXXFLAGS) $(PLATFORM_SHARED_CFLAGS) $(SHARED_OUTDIR)/db/db_bench.o $(TESTUTIL) $(SHARED_OUTDIR)/$(SHARED_LIB3) -o $@ $(LIBS) + + .PHONY: run-shared +-- +2.17.1 + diff --git a/bsp/buildroot/package/libarchive/0001-Do-something-sensible-for-empty-strings-to-make-fuzz.patch b/bsp/buildroot/package/libarchive/0001-Do-something-sensible-for-empty-strings-to-make-fuzz.patch deleted file mode 100644 index 1d1d80d7..00000000 --- a/bsp/buildroot/package/libarchive/0001-Do-something-sensible-for-empty-strings-to-make-fuzz.patch +++ /dev/null @@ -1,42 +0,0 @@ -From fa7438a0ff4033e4741c807394a9af6207940d71 Mon Sep 17 00:00:00 2001 -From: Joerg Sonnenberger -Date: Tue, 5 Sep 2017 18:12:19 +0200 -Subject: [PATCH] Do something sensible for empty strings to make fuzzers - happy. - -Signed-off-by: Baruch Siach ---- -Upstream status: commit fa7438a0ff - - libarchive/archive_read_support_format_xar.c | 8 +++++++- - 1 file changed, 7 insertions(+), 1 deletion(-) - -diff --git a/libarchive/archive_read_support_format_xar.c b/libarchive/archive_read_support_format_xar.c -index 7a22beb9d8e4..93eeacc5e6eb 100644 ---- a/libarchive/archive_read_support_format_xar.c -+++ b/libarchive/archive_read_support_format_xar.c -@@ -1040,6 +1040,9 @@ atol10(const char *p, size_t char_cnt) - uint64_t l; - int digit; - -+ if (char_cnt == 0) -+ return (0); -+ - l = 0; - digit = *p - '0'; - while (digit >= 0 && digit < 10 && char_cnt-- > 0) { -@@ -1054,7 +1057,10 @@ atol8(const char *p, size_t char_cnt) - { - int64_t l; - int digit; -- -+ -+ if (char_cnt == 0) -+ return (0); -+ - l = 0; - while (char_cnt-- > 0) { - if (*p >= '0' && *p <= '7') --- -2.14.1 - diff --git a/bsp/buildroot/package/libarchive/0002-iso9660-validate-directory-record-length.patch b/bsp/buildroot/package/libarchive/0002-iso9660-validate-directory-record-length.patch deleted file mode 100644 index 8a0c34f2..00000000 --- a/bsp/buildroot/package/libarchive/0002-iso9660-validate-directory-record-length.patch +++ /dev/null @@ -1,78 +0,0 @@ -From f9569c086ff29259c73790db9cbf39fe8fb9d862 Mon Sep 17 00:00:00 2001 -From: John Starks -Date: Wed, 25 Jul 2018 12:16:34 -0700 -Subject: [PATCH] iso9660: validate directory record length - -Signed-off-by: Baruch Siach ---- -Upstream status: commit f9569c086ff - - .../archive_read_support_format_iso9660.c | 17 +++++++++++------ - 1 file changed, 11 insertions(+), 6 deletions(-) - -diff --git a/libarchive/archive_read_support_format_iso9660.c b/libarchive/archive_read_support_format_iso9660.c -index f01d37bf682e..089bb7236cd1 100644 ---- a/libarchive/archive_read_support_format_iso9660.c -+++ b/libarchive/archive_read_support_format_iso9660.c -@@ -409,7 +409,8 @@ static int next_entry_seek(struct archive_read *, struct iso9660 *, - struct file_info **); - static struct file_info * - parse_file_info(struct archive_read *a, -- struct file_info *parent, const unsigned char *isodirrec); -+ struct file_info *parent, const unsigned char *isodirrec, -+ size_t reclen); - static int parse_rockridge(struct archive_read *a, - struct file_info *file, const unsigned char *start, - const unsigned char *end); -@@ -1022,7 +1023,7 @@ read_children(struct archive_read *a, struct file_info *parent) - if (*(p + DR_name_len_offset) == 1 - && *(p + DR_name_offset) == '\001') - continue; -- child = parse_file_info(a, parent, p); -+ child = parse_file_info(a, parent, p, b - p); - if (child == NULL) { - __archive_read_consume(a, skip_size); - return (ARCHIVE_FATAL); -@@ -1112,7 +1113,7 @@ choose_volume(struct archive_read *a, struct iso9660 *iso9660) - */ - seenJoliet = iso9660->seenJoliet;/* Save flag. */ - iso9660->seenJoliet = 0; -- file = parse_file_info(a, NULL, block); -+ file = parse_file_info(a, NULL, block, vd->size); - if (file == NULL) - return (ARCHIVE_FATAL); - iso9660->seenJoliet = seenJoliet; -@@ -1144,7 +1145,7 @@ choose_volume(struct archive_read *a, struct iso9660 *iso9660) - return (ARCHIVE_FATAL); - } - iso9660->seenJoliet = 0; -- file = parse_file_info(a, NULL, block); -+ file = parse_file_info(a, NULL, block, vd->size); - if (file == NULL) - return (ARCHIVE_FATAL); - iso9660->seenJoliet = seenJoliet; -@@ -1749,7 +1750,7 @@ archive_read_format_iso9660_cleanup(struct archive_read *a) - */ - static struct file_info * - parse_file_info(struct archive_read *a, struct file_info *parent, -- const unsigned char *isodirrec) -+ const unsigned char *isodirrec, size_t reclen) - { - struct iso9660 *iso9660; - struct file_info *file, *filep; -@@ -1763,7 +1764,11 @@ parse_file_info(struct archive_read *a, struct file_info *parent, - - iso9660 = (struct iso9660 *)(a->format->data); - -- dr_len = (size_t)isodirrec[DR_length_offset]; -+ if (reclen == 0 || reclen < (dr_len = (size_t)isodirrec[DR_length_offset])) { -+ archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC, -+ "Invalid directory record length"); -+ return (NULL); -+ } - name_len = (size_t)isodirrec[DR_name_len_offset]; - location = archive_le32dec(isodirrec + DR_extent_offset); - fsize = toi(isodirrec + DR_size_offset, DR_size_size); --- -2.18.0 - diff --git a/bsp/buildroot/package/libarchive/0003-Avoid-a-read-off-by-one-error-for-UTF16-names-in-RAR.patch b/bsp/buildroot/package/libarchive/0003-Avoid-a-read-off-by-one-error-for-UTF16-names-in-RAR.patch deleted file mode 100644 index 13a80d1f..00000000 --- a/bsp/buildroot/package/libarchive/0003-Avoid-a-read-off-by-one-error-for-UTF16-names-in-RAR.patch +++ /dev/null @@ -1,34 +0,0 @@ -From 5562545b5562f6d12a4ef991fae158bf4ccf92b6 Mon Sep 17 00:00:00 2001 -From: Joerg Sonnenberger -Date: Sat, 9 Sep 2017 17:47:32 +0200 -Subject: [PATCH] Avoid a read off-by-one error for UTF16 names in RAR - archives. - -Reported-By: OSS-Fuzz issue 573 -Signed-off-by: Baruch Siach ---- -Upstream status: commit 5562545b5562 - - libarchive/archive_read_support_format_rar.c | 6 +++++- - 1 file changed, 5 insertions(+), 1 deletion(-) - -diff --git a/libarchive/archive_read_support_format_rar.c b/libarchive/archive_read_support_format_rar.c -index cbb14c32dc3b..751de6979ba5 100644 ---- a/libarchive/archive_read_support_format_rar.c -+++ b/libarchive/archive_read_support_format_rar.c -@@ -1496,7 +1496,11 @@ read_header(struct archive_read *a, struct archive_entry *entry, - return (ARCHIVE_FATAL); - } - filename[filename_size++] = '\0'; -- filename[filename_size++] = '\0'; -+ /* -+ * Do not increment filename_size here as the computations below -+ * add the space for the terminating NUL explicitly. -+ */ -+ filename[filename_size] = '\0'; - - /* Decoded unicode form is UTF-16BE, so we have to update a string - * conversion object for it. */ --- -2.18.0 - diff --git a/bsp/buildroot/package/libarchive/0004-Reject-LHA-archive-entries-with-negative-size.patch b/bsp/buildroot/package/libarchive/0004-Reject-LHA-archive-entries-with-negative-size.patch deleted file mode 100644 index 628e74ae..00000000 --- a/bsp/buildroot/package/libarchive/0004-Reject-LHA-archive-entries-with-negative-size.patch +++ /dev/null @@ -1,32 +0,0 @@ -From 2c8c83b9731ff822fad6cc8c670ea5519c366a14 Mon Sep 17 00:00:00 2001 -From: Joerg Sonnenberger -Date: Thu, 19 Jul 2018 21:14:53 +0200 -Subject: [PATCH] Reject LHA archive entries with negative size. - -Signed-off-by: Baruch Siach ---- -Upstream status: commit 2c8c83b9731 - - libarchive/archive_read_support_format_lha.c | 6 ++++++ - 1 file changed, 6 insertions(+) - -diff --git a/libarchive/archive_read_support_format_lha.c b/libarchive/archive_read_support_format_lha.c -index b8ef4ae10ece..95c99bb1f31e 100644 ---- a/libarchive/archive_read_support_format_lha.c -+++ b/libarchive/archive_read_support_format_lha.c -@@ -701,6 +701,12 @@ archive_read_format_lha_read_header(struct archive_read *a, - * Prepare variables used to read a file content. - */ - lha->entry_bytes_remaining = lha->compsize; -+ if (lha->entry_bytes_remaining < 0) { -+ archive_set_error(&a->archive, -+ ARCHIVE_ERRNO_FILE_FORMAT, -+ "Invalid LHa entry size"); -+ return (ARCHIVE_FATAL); -+ } - lha->entry_offset = 0; - lha->entry_crc_calculated = 0; - --- -2.18.0 - diff --git a/bsp/buildroot/package/libarchive/libarchive.hash b/bsp/buildroot/package/libarchive/libarchive.hash index 60ea0d16..cde48c84 100644 --- a/bsp/buildroot/package/libarchive/libarchive.hash +++ b/bsp/buildroot/package/libarchive/libarchive.hash @@ -1,3 +1,4 @@ +# From http://www.libarchive.org/downloads/libarchive-3.3.3.sha512.txt +sha512 9d12b47d6976efa9f98e62c25d8b85fd745d4e9ca7b7e6d36bfe095dfe5c4db017d4e785d110f3758f5938dad6f1a1b009267fd7e82cb7212e93e1aea237bab7 libarchive-3.3.3.tar.gz # Locally computed: -sha256 ed2dbd6954792b2c054ccf8ec4b330a54b85904a80cef477a1c74643ddafa0ce libarchive-3.3.2.tar.gz sha256 ae6f35cc1979beb316e4d6431fc34c6fc59f0dd126b425c8552bb41c86e4825d COPYING diff --git a/bsp/buildroot/package/libarchive/libarchive.mk b/bsp/buildroot/package/libarchive/libarchive.mk index 1c8391bd..b7619b03 100644 --- a/bsp/buildroot/package/libarchive/libarchive.mk +++ b/bsp/buildroot/package/libarchive/libarchive.mk @@ -4,7 +4,7 @@ # ################################################################################ -LIBARCHIVE_VERSION = 3.3.2 +LIBARCHIVE_VERSION = 3.3.3 LIBARCHIVE_SITE = http://www.libarchive.org/downloads LIBARCHIVE_INSTALL_STAGING = YES LIBARCHIVE_LICENSE = BSD-2-Clause, BSD-3-Clause diff --git a/bsp/buildroot/package/libcurl/libcurl.hash b/bsp/buildroot/package/libcurl/libcurl.hash index 39530765..43294353 100644 --- a/bsp/buildroot/package/libcurl/libcurl.hash +++ b/bsp/buildroot/package/libcurl/libcurl.hash @@ -1,5 +1,5 @@ # Locally calculated after checking pgp signature -# https://curl.haxx.se/download/curl-7.61.1.tar.xz.asc +# https://curl.haxx.se/download/curl-7.62.0.tar.xz.asc # with key 27EDEAF22F3ABCEB50DB9A125CC908FDB71E12C2 -sha256 3d5913d6a39bd22e68e34dff697fd6e4c3c81563f580c76fca2009315cd81891 curl-7.61.1.tar.xz +sha256 dab5643a5fe775ae92570b9f3df6b0ef4bc2a827a959361fb130c73b721275c1 curl-7.62.0.tar.xz sha256 5f3849ec38ddb927e79f514bf948890c41b8d1407286a49609b8fb1585931095 COPYING diff --git a/bsp/buildroot/package/libcurl/libcurl.mk b/bsp/buildroot/package/libcurl/libcurl.mk index 92c1a1fb..af82ae0c 100644 --- a/bsp/buildroot/package/libcurl/libcurl.mk +++ b/bsp/buildroot/package/libcurl/libcurl.mk @@ -4,7 +4,7 @@ # ################################################################################ -LIBCURL_VERSION = 7.61.1 +LIBCURL_VERSION = 7.62.0 LIBCURL_SOURCE = curl-$(LIBCURL_VERSION).tar.xz LIBCURL_SITE = https://curl.haxx.se/download LIBCURL_DEPENDENCIES = host-pkgconf \ @@ -75,6 +75,13 @@ else LIBCURL_CONF_OPTS += --without-libssh2 endif +ifeq ($(BR2_PACKAGE_BROTLI),y) +LIBCURL_DEPENDENCIES += brotli +LIBCURL_CONF_OPTS += --with-brotli +else +LIBCURL_CONF_OPTS += --without-brotli +endif + define LIBCURL_FIX_DOT_PC printf 'Requires: openssl\n' >>$(@D)/libcurl.pc.in endef diff --git a/bsp/buildroot/package/libiscsi/0002-avoid-truncation-when-logging-message-that-includes-target-name.patch b/bsp/buildroot/package/libiscsi/0002-avoid-truncation-when-logging-message-that-includes-target-name.patch new file mode 100644 index 00000000..1334a835 --- /dev/null +++ b/bsp/buildroot/package/libiscsi/0002-avoid-truncation-when-logging-message-that-includes-target-name.patch @@ -0,0 +1,29 @@ +From bffafc1c3003c2ee05d28eaa345e5854bc36014d Mon Sep 17 00:00:00 2001 +From: Paolo Bonzini +Date: Mon, 1 Oct 2018 14:16:14 +0200 +Subject: [PATCH] avoid truncation when logging message that includes target + name + +Signed-off-by: Fabrice Fontaine +[Retrieved from: +https://github.com/sahlberg/libiscsi/commit/bffafc1c3003c2ee05d28eaa345e5854bc36014d] +--- + lib/logging.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/lib/logging.c b/lib/logging.c +index be518fc5..61c74407 100644 +--- a/lib/logging.c ++++ b/lib/logging.c +@@ -73,9 +73,9 @@ iscsi_log_message(struct iscsi_context *iscsi, int level, const char *format, .. + } + + if (iscsi->target_name[0]) { +- static char message2[1024]; ++ static char message2[1282]; + +- snprintf(message2, 1024, "%s [%s]", message, iscsi->target_name); ++ snprintf(message2, 1282, "%s [%s]", message, iscsi->target_name); + iscsi->log_fn(level, message2); + } + else diff --git a/bsp/buildroot/package/libiscsi/0003-avoid-fallthrough.patch b/bsp/buildroot/package/libiscsi/0003-avoid-fallthrough.patch new file mode 100644 index 00000000..94f653a9 --- /dev/null +++ b/bsp/buildroot/package/libiscsi/0003-avoid-fallthrough.patch @@ -0,0 +1,24 @@ +From 679d0abe7c142df178a907397551c4d9695cc667 Mon Sep 17 00:00:00 2001 +From: Paolo Bonzini +Date: Mon, 1 Oct 2018 14:14:24 +0200 +Subject: [PATCH] avoid fallthrough + +Signed-off-by: Fabrice Fontaine +[Retrieved from: +https://github.com/sahlberg/libiscsi/commit/679d0abe7c142df178a907397551c4d9695cc667] +--- + lib/scsi-lowlevel.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/lib/scsi-lowlevel.c b/lib/scsi-lowlevel.c +index 5ddd709c..747ce0c4 100644 +--- a/lib/scsi-lowlevel.c ++++ b/lib/scsi-lowlevel.c +@@ -1086,6 +1086,7 @@ scsi_maintenancein_datain_getfullsize(struct scsi_task *task) + (task_get_uint8(task, 1) & 0x80) ? 12 : 0 + + task_get_uint16(task, 2); + } ++ return -1; + default: + return -1; + } diff --git a/bsp/buildroot/package/libiscsi/libiscsi.hash b/bsp/buildroot/package/libiscsi/libiscsi.hash index 4f7d1af5..0688f2dd 100644 --- a/bsp/buildroot/package/libiscsi/libiscsi.hash +++ b/bsp/buildroot/package/libiscsi/libiscsi.hash @@ -1,2 +1,5 @@ # Locally computed: sha256 464d104e12533dc11f0dd7662cbc2f01c132f94aa4f5bd519e3413ef485830e8 libiscsi-1.18.0.tar.gz +sha256 88e3eccc48722b2a0eaff456dda94b8e8e123848d01f631969bec8e3c6c6eb85 COPYING +sha256 8177f97513213526df2cf6184d8ff986c675afb514d4e68a404010521b880643 LICENCE-GPL-2.txt +sha256 dc626520dcd53a22f727af3ee42c770e56c97a64fe3adb063799d8ab032fe551 LICENCE-LGPL-2.1.txt diff --git a/bsp/buildroot/package/libkcapi/libkcapi.mk b/bsp/buildroot/package/libkcapi/libkcapi.mk index d21c81b1..1e273717 100644 --- a/bsp/buildroot/package/libkcapi/libkcapi.mk +++ b/bsp/buildroot/package/libkcapi/libkcapi.mk @@ -11,6 +11,10 @@ LIBKCAPI_AUTORECONF = YES LIBKCAPI_INSTALL_STAGING = YES LIBKCAPI_LICENSE = BSD-3-Clause (library), BSD-3-Clause or GPL-2.0 (programs) LIBKCAPI_LICENSE_FILES = COPYING COPYING.gplv2 COPYING.bsd +LIBKCAPI_CONF_ENV = \ + ac_cv_path_DB2PDF="" \ + ac_cv_path_DB2PS="" \ + ac_cv_path_XMLTO="" ifeq ($(BR2_PACKAGE_LIBKCAPI_APPS),y) LIBKCAPI_CONF_OPTS += \ diff --git a/bsp/buildroot/package/libnfs/0001-Fix-include-sys-time.h.patch b/bsp/buildroot/package/libnfs/0001-Fix-include-sys-time.h.patch new file mode 100644 index 00000000..15b28167 --- /dev/null +++ b/bsp/buildroot/package/libnfs/0001-Fix-include-sys-time.h.patch @@ -0,0 +1,41 @@ +From 9df082012cba1dc32d83e5e8b0bdc0892f250058 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?J=C3=B6rg=20Krause?= +Date: Mon, 5 Nov 2018 00:43:07 +0100 +Subject: [PATCH] Fix include sys/time.h +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +POSIX says `struct timeval` is defined if is included. + +Instead of the mess that is currently done based on the system on which +the stuff is being compiled, include it unconditionally. + +Reported upstream: +https://github.com/sahlberg/libnfs/issues/272 + +Signed-off-by: Jörg Krause +--- + include/nfsc/libnfs.h | 5 ----- + 1 file changed, 5 deletions(-) + +diff --git a/include/nfsc/libnfs.h b/include/nfsc/libnfs.h +index 09dcf1c..b6db58c 100755 +--- a/include/nfsc/libnfs.h ++++ b/include/nfsc/libnfs.h +@@ -24,12 +24,7 @@ + #define _LIBNFS_H_ + + #include +-#if defined(__ANDROID__) || defined(AROS) \ +- || ( defined(__APPLE__) && defined(__MACH__) ) + #include +-#else +-#include +-#endif + + #ifdef __cplusplus + extern "C" { +-- +2.19.1 + diff --git a/bsp/buildroot/package/libnspr/0001-nios2.patch b/bsp/buildroot/package/libnspr/0001-nios2.patch index e10e7e9a..2a967c45 100644 --- a/bsp/buildroot/package/libnspr/0001-nios2.patch +++ b/bsp/buildroot/package/libnspr/0001-nios2.patch @@ -2,14 +2,16 @@ Add Nios-II support [Gustavo: update for nspr 4.10.9] Signed-off-by: Ezequiel Garcia +[Fabrice: update for nspr 4.20] +Signed-off-by: Fabrice Fontaine Index: b/nspr/pr/include/md/_linux.cfg =================================================================== --- a/nspr/pr/include/md/_linux.cfg +++ b/nspr/pr/include/md/_linux.cfg -@@ -1017,6 +1017,51 @@ - #define PR_BYTES_PER_WORD_LOG2 2 - #define PR_BYTES_PER_DWORD_LOG2 3 +@@ -1112,6 +1112,51 @@ + #define PR_BYTES_PER_WORD_LOG2 3 + #define PR_BYTES_PER_DWORD_LOG2 3 +#elif defined(__nios2__) + @@ -64,9 +66,9 @@ Index: b/nspr/pr/include/md/_linux.h --- a/nspr/pr/include/md/_linux.h +++ b/nspr/pr/include/md/_linux.h @@ -57,6 +57,8 @@ - #define _PR_SI_ARCHITECTURE "m32r" - #elif defined(__or1k__) - #define _PR_SI_ARCHITECTURE "or1k" + #define _PR_SI_ARCHITECTURE "riscv32" + #elif defined(__riscv) && (__riscv_xlen == 64) + #define _PR_SI_ARCHITECTURE "riscv64" +#elif defined(__nios2__) +#define _PR_SI_ARCHITECTURE "nios2" #else diff --git a/bsp/buildroot/package/libnspr/0002-microblaze.patch b/bsp/buildroot/package/libnspr/0002-microblaze.patch index 7cf1f0df..4c23259d 100644 --- a/bsp/buildroot/package/libnspr/0002-microblaze.patch +++ b/bsp/buildroot/package/libnspr/0002-microblaze.patch @@ -2,12 +2,14 @@ Add Microblaze support [Gustavo: update for nspr 4.10.9] Signed-off-by: Spenser Gilliland +[Fabrice: update for nspr 4.20] +Signed-off-by: Fabrice Fontaine Index: b/nspr/pr/include/md/_linux.cfg =================================================================== --- a/nspr/pr/include/md/_linux.cfg +++ b/nspr/pr/include/md/_linux.cfg -@@ -1062,6 +1062,56 @@ +@@ -1157,6 +1157,56 @@ #define PR_BYTES_PER_WORD_LOG2 2 #define PR_BYTES_PER_DWORD_LOG2 3 @@ -69,9 +71,9 @@ Index: b/nspr/pr/include/md/_linux.h --- a/nspr/pr/include/md/_linux.h +++ b/nspr/pr/include/md/_linux.h @@ -57,6 +57,8 @@ - #define _PR_SI_ARCHITECTURE "m32r" - #elif defined(__or1k__) - #define _PR_SI_ARCHITECTURE "or1k" + #define _PR_SI_ARCHITECTURE "riscv32" + #elif defined(__riscv) && (__riscv_xlen == 64) + #define _PR_SI_ARCHITECTURE "riscv64" +#elif defined(__microblaze__) +#define _PR_SI_ARCHITECTURE "microblaze" #elif defined(__nios2__) diff --git a/bsp/buildroot/package/libnspr/libnspr.hash b/bsp/buildroot/package/libnspr/libnspr.hash index 46c091e0..33710b65 100644 --- a/bsp/buildroot/package/libnspr/libnspr.hash +++ b/bsp/buildroot/package/libnspr/libnspr.hash @@ -1,4 +1,4 @@ -# From https://ftp.mozilla.org/pub/nspr/releases/v4.17/src/SHA256SUMS -sha256 590a0aea29412ae22d7728038c21ef2ab42646e48172a47d2e4bb782846d1095 nspr-4.17.tar.gz +# From https://ftp.mozilla.org/pub/nspr/releases/v4.20/src/SHA256SUMS +sha256 2c8964913da89ffbaf464d49ce44d79e8804e1794ef9a8c52a7bff7224d1556e nspr-4.20.tar.gz # Locally calculated sha256 fab3dd6bdab226f1c08630b1dd917e11fcb4ec5e1e020e2c16f83a0a13863e85 nspr/LICENSE diff --git a/bsp/buildroot/package/libnspr/libnspr.mk b/bsp/buildroot/package/libnspr/libnspr.mk index 0c782ae3..c87947e5 100644 --- a/bsp/buildroot/package/libnspr/libnspr.mk +++ b/bsp/buildroot/package/libnspr/libnspr.mk @@ -4,7 +4,7 @@ # ################################################################################ -LIBNSPR_VERSION = 4.17 +LIBNSPR_VERSION = 4.20 LIBNSPR_SOURCE = nspr-$(LIBNSPR_VERSION).tar.gz LIBNSPR_SITE = https://ftp.mozilla.org/pub/mozilla.org/nspr/releases/v$(LIBNSPR_VERSION)/src LIBNSPR_SUBDIR = nspr diff --git a/bsp/buildroot/package/libnss/0001-fix-uclibc-build.patch b/bsp/buildroot/package/libnss/0001-fix-uclibc-build.patch new file mode 100644 index 00000000..a9e84c26 --- /dev/null +++ b/bsp/buildroot/package/libnss/0001-fix-uclibc-build.patch @@ -0,0 +1,22 @@ +Fix build with uClibc-ng + +The elf.h header in uClibc-ng is missing the AT_HWCAP2 definition. Add it in +the code. + +Signed-off-by: Baruch Siach +--- +Upstream status: Not upstreamable; uClibc needs to update elf.h + +diff -Nuar nss-3.38.orig/nss/lib/freebl/blinit.c nss-3.38/nss/lib/freebl/blinit.c +--- nss-3.38.orig/nss/lib/freebl/blinit.c 2018-06-21 12:24:45.000000000 +0300 ++++ nss-3.38/nss/lib/freebl/blinit.c 2018-06-26 13:13:55.636434720 +0300 +@@ -100,6 +100,9 @@ + defined(__GNUC__) && __GNUC__ >= 2 && defined(__ELF__) + #include + extern unsigned long getauxval(unsigned long type) __attribute__((weak)); ++#ifndef AT_HWCAP2 ++#define AT_HWCAP2 26 ++#endif + #else + static unsigned long (*getauxval)(unsigned long) = NULL; + #define AT_HWCAP2 0 diff --git a/bsp/buildroot/package/libnss/0001-uclibc.patch b/bsp/buildroot/package/libnss/0001-uclibc.patch deleted file mode 100644 index b81db930..00000000 --- a/bsp/buildroot/package/libnss/0001-uclibc.patch +++ /dev/null @@ -1,20 +0,0 @@ -uCLibc does not define RTLD_NOLOAD. - -[Gustavo: update for nss 3.16.1] -Signed-off-by: Will Newton - -diff -Nura nss-3.16.1.orig/nss/lib/freebl/stubs.c nss-3.16.1/nss/lib/freebl/stubs.c ---- nss-3.16.1.orig/nss/lib/freebl/stubs.c 2014-06-18 10:34:30.529997002 -0300 -+++ nss-3.16.1/nss/lib/freebl/stubs.c 2014-06-18 10:36:25.508882650 -0300 -@@ -594,6 +594,11 @@ - return SECSuccess; - } - -+/* uClibc does not define RTLD_NOLOAD. */ -+#ifndef RTLD_NOLOAD -+#define RTLD_NOLOAD 0 -+#endif -+ - /* - * fetch the library if it's loaded. For NSS it should already be loaded - */ diff --git a/bsp/buildroot/package/libnss/0004-Bug-1438426-Avoid-stringop-truncation-warning-r-fran.patch b/bsp/buildroot/package/libnss/0004-Bug-1438426-Avoid-stringop-truncation-warning-r-fran.patch deleted file mode 100644 index c14880b1..00000000 --- a/bsp/buildroot/package/libnss/0004-Bug-1438426-Avoid-stringop-truncation-warning-r-fran.patch +++ /dev/null @@ -1,33 +0,0 @@ -From f0ce70989526fc9a0223398c99ea0d09777ea5df Mon Sep 17 00:00:00 2001 -From: Martin Thomson -Date: Thu, 15 Feb 2018 16:34:02 +1100 -Subject: [PATCH] Bug 1438426 - Avoid stringop-truncation warning, r=franziskus - ---HG-- -extra : rebase_source : 4ea1630d0da0ce3523309e3da33ee50961682242 - -Upstream-commit: https://github.com/nss-dev/nss/commit/f0ce70989526fc9a0223398c99ea0d09777ea5df -[Thomas: edited after git format-patch to add the nss/ prefix needed -for the patch to apply properly on the source code extracted by the -tarball.] -Signed-off-by: Thomas Petazzoni ---- - nss/coreconf/nsinstall/pathsub.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/nss/coreconf/nsinstall/pathsub.c b/nss/coreconf/nsinstall/pathsub.c -index a42a9f30a..c31a946f0 100644 ---- a/nss/coreconf/nsinstall/pathsub.c -+++ b/nss/coreconf/nsinstall/pathsub.c -@@ -212,7 +212,7 @@ reversepath(char *inpath, char *name, int len, char *outpath) - xchdir(".."); - } else { - cp -= 3; -- strncpy(cp, "../", 3); -+ memcpy(cp, "../", 3); - xchdir(buf); - } - } --- -2.14.3 - diff --git a/bsp/buildroot/package/libnss/libnss.hash b/bsp/buildroot/package/libnss/libnss.hash index 6c8ce837..9c3cefd8 100644 --- a/bsp/buildroot/package/libnss/libnss.hash +++ b/bsp/buildroot/package/libnss/libnss.hash @@ -1,4 +1,4 @@ -# From https://ftp.mozilla.org/pub/security/nss/releases/NSS_3_33_RTM/src/SHA256SUMS -sha256 98f0dabd36408e83dd3a11727336cc3cdfee4cbdd9aede2b2831eb2389c284e4 nss-3.33.tar.gz +# From https://ftp.mozilla.org/pub/security/nss/releases/NSS_3_39_RTM/src/SHA256SUMS +sha256 6be64dd76f212415cc8bc34343ac1e7389048db4db9a023a84873c411dc5864b nss-3.39.tar.gz # Locally calculated sha256 a20c1a32d1f8102432360b42e932869f7c11c7cdbacf9cac554c422132af47f4 nss/COPYING diff --git a/bsp/buildroot/package/libnss/libnss.mk b/bsp/buildroot/package/libnss/libnss.mk index 27d305cc..e3558718 100644 --- a/bsp/buildroot/package/libnss/libnss.mk +++ b/bsp/buildroot/package/libnss/libnss.mk @@ -4,7 +4,7 @@ # ################################################################################ -LIBNSS_VERSION = 3.33 +LIBNSS_VERSION = 3.39 LIBNSS_SOURCE = nss-$(LIBNSS_VERSION).tar.gz LIBNSS_SITE = https://ftp.mozilla.org/pub/mozilla.org/security/nss/releases/NSS_$(subst .,_,$(LIBNSS_VERSION))_RTM/src LIBNSS_DISTDIR = dist @@ -23,6 +23,12 @@ endef LIBNSS_PRE_CONFIGURE_HOOKS += LIBNSS_DROP_GC_SECTIONS endif +ifeq ($(BR2_aarch64_be),y) +LIBNSS_ARCH = aarch64 +else +LIBNSS_ARCH = $(ARCH) +endif + LIBNSS_BUILD_VARS = \ MOZILLA_CLIENT=1 \ NSPR_INCLUDE_DIR=$(STAGING_DIR)/usr/include/nspr \ @@ -35,7 +41,7 @@ LIBNSS_BUILD_VARS = \ NATIVE_CC="$(HOSTCC)" \ OS_ARCH="Linux" \ OS_RELEASE="2.6" \ - OS_TEST="$(ARCH)" + OS_TEST="$(LIBNSS_ARCH)" # #pragma usage needs gcc >= 4.8 # See https://bugzilla.mozilla.org/show_bug.cgi?id=1226179 diff --git a/bsp/buildroot/package/libsemanage/libsemanage.mk b/bsp/buildroot/package/libsemanage/libsemanage.mk index b6e50e28..6ef81bf7 100644 --- a/bsp/buildroot/package/libsemanage/libsemanage.mk +++ b/bsp/buildroot/package/libsemanage/libsemanage.mk @@ -31,7 +31,8 @@ HOST_LIBSEMANAGE_DEPENDENCIES = host-bison host-audit host-libsepol host-libseli HOST_LIBSEMANAGE_MAKE_OPTS += \ $(HOST_CONFIGURE_OPTS) \ PREFIX=$(HOST_DIR) \ - SWIG_LIB="$(HOST_DIR)/share/swig/$(SWIG_VERSION)/" + SWIG_LIB="$(HOST_DIR)/share/swig/$(SWIG_VERSION)/" \ + DEFAULT_SEMANAGE_CONF_LOCATION=$(HOST_DIR)/etc/selinux/semanage.conf ifeq ($(BR2_PACKAGE_PYTHON3),y) HOST_LIBSEMANAGE_DEPENDENCIES += host-python3 diff --git a/bsp/buildroot/package/libssh/libssh.hash b/bsp/buildroot/package/libssh/libssh.hash index 009a335e..257b93cb 100644 --- a/bsp/buildroot/package/libssh/libssh.hash +++ b/bsp/buildroot/package/libssh/libssh.hash @@ -1,5 +1,5 @@ -# from https://red.libssh.org/projects/libssh/files/ -md5 d3fc864208bf607ad87cdee836894feb libssh-0.7.5.tar.xz -# Locally calculated after checking signature on uncompressed libssh-0.7.5.tar -# https://red.libssh.org/attachments/download/217/libssh-0.7.5.tar.asc -sha256 54e86dd5dc20e5367e58f3caab337ce37675f863f80df85b6b1614966a337095 libssh-0.7.5.tar.xz +# Locally calculated after checking pgp signature +# https://www.libssh.org/files/0.8/libssh-0.8.4.tar.xz.asc +# with key 8DFF53E18F2ABC8D8F3C92237EE0FC4DCC014E3D +sha256 6bb07713021a8586ba2120b2c36c468dc9ac8096d043f9b1726639aa4275b81b libssh-0.8.4.tar.xz +sha256 468cf08f784ef6fd3b3705b60dd8111e2b70fbb8f6549cd503665a6bbb3bc625 COPYING diff --git a/bsp/buildroot/package/libssh/libssh.mk b/bsp/buildroot/package/libssh/libssh.mk index 902865d7..1ef09b3a 100644 --- a/bsp/buildroot/package/libssh/libssh.mk +++ b/bsp/buildroot/package/libssh/libssh.mk @@ -4,8 +4,8 @@ # ################################################################################ -LIBSSH_VERSION_MAJOR = 0.7 -LIBSSH_VERSION = $(LIBSSH_VERSION_MAJOR).5 +LIBSSH_VERSION_MAJOR = 0.8 +LIBSSH_VERSION = $(LIBSSH_VERSION_MAJOR).4 LIBSSH_SOURCE = libssh-$(LIBSSH_VERSION).tar.xz LIBSSH_SITE = https://www.libssh.org/files/$(LIBSSH_VERSION_MAJOR) LIBSSH_LICENSE = LGPL-2.1 @@ -17,6 +17,9 @@ LIBSSH_CONF_OPTS = \ -DWITH_SERVER=OFF \ -DWITH_EXAMPLES=OFF +# cmake older than 3.10 require this to avoid try_run() in FindThreads +LIBSSH_CONF_OPTS += -DTHREADS_PTHREAD_ARG=OFF + ifeq ($(BR2_PACKAGE_ZLIB),y) LIBSSH_CONF_OPTS += -DWITH_ZLIB=ON LIBSSH_DEPENDENCIES += zlib diff --git a/bsp/buildroot/package/liburiparser/Config.in b/bsp/buildroot/package/liburiparser/Config.in index e85a2626..b39e3907 100644 --- a/bsp/buildroot/package/liburiparser/Config.in +++ b/bsp/buildroot/package/liburiparser/Config.in @@ -4,4 +4,4 @@ config BR2_PACKAGE_LIBURIPARSER uriparser is a strictly RFC 3986 compliant URI parsing and handling library written in C. - http://uriparser.sourceforge.net + https://uriparser.github.io diff --git a/bsp/buildroot/package/liburiparser/liburiparser.hash b/bsp/buildroot/package/liburiparser/liburiparser.hash index 9e9517c1..f71dd5cc 100644 --- a/bsp/buildroot/package/liburiparser/liburiparser.hash +++ b/bsp/buildroot/package/liburiparser/liburiparser.hash @@ -1,5 +1,3 @@ -# From http://sourceforge.net/projects/uriparser/files/Sources/0.8.4/ -md5 9aabdc3611546f553f4af372167de6d6 uriparser-0.8.4.tar.bz2 -sha1 7a1948c20bed54b04dad0e1d7d2fa8f80fc7b2b3 uriparser-0.8.4.tar.bz2 # Locally calculated -sha256 c6ef125800c2ef13a41a22126bfc77e8b8c08993a6b96196117695988ea76249 COPYING +sha256 ec67eb34feda8eac166f281799f03ed48387694fca44f6f5852f61f8fb535e2c uriparser-0.9.0.tar.bz2 +sha256 ee90029e62d11f48faa59360d15c3ad8e7c094c74cc25b055716d92340da561f COPYING diff --git a/bsp/buildroot/package/liburiparser/liburiparser.mk b/bsp/buildroot/package/liburiparser/liburiparser.mk index 856a6aaf..62bc8d30 100644 --- a/bsp/buildroot/package/liburiparser/liburiparser.mk +++ b/bsp/buildroot/package/liburiparser/liburiparser.mk @@ -4,9 +4,9 @@ # ################################################################################ -LIBURIPARSER_VERSION = 0.8.4 +LIBURIPARSER_VERSION = 0.9.0 LIBURIPARSER_SOURCE = uriparser-$(LIBURIPARSER_VERSION).tar.bz2 -LIBURIPARSER_SITE = http://sourceforge.net/projects/uriparser/files/Sources/$(LIBURIPARSER_VERSION) +LIBURIPARSER_SITE = https://github.com/uriparser/uriparser/releases/download/uriparser-$(LIBURIPARSER_VERSION) LIBURIPARSER_LICENSE = BSD-3-Clause LIBURIPARSER_LICENSE_FILES = COPYING LIBURIPARSER_INSTALL_STAGING = YES diff --git a/bsp/buildroot/package/lighttpd/lighttpd.hash b/bsp/buildroot/package/lighttpd/lighttpd.hash index 813d1cd0..0829c6b4 100644 --- a/bsp/buildroot/package/lighttpd/lighttpd.hash +++ b/bsp/buildroot/package/lighttpd/lighttpd.hash @@ -1,4 +1,4 @@ -# From http://www.lighttpd.net/ -sha256 0f8ad5aac7529d7b948b9d7e8cd0b4a9e177309d85d6bf6516e28e6e40d74f36 lighttpd-1.4.48.tar.xz +# From https://download.lighttpd.net/lighttpd/releases-1.4.x/lighttpd-1.4.51.sha256sum +sha256 2af9fdb265d1f025bfa634e13770239712ecbd585e4975b8226edf1df74e9c82 lighttpd-1.4.51.tar.xz # Locally calculated sha256 5c98cad2fbaf5c5e2562bcbab401a7c557c1bb1bac9914ecc63730925052fb13 COPYING diff --git a/bsp/buildroot/package/lighttpd/lighttpd.mk b/bsp/buildroot/package/lighttpd/lighttpd.mk index 0a09d912..44bee6f9 100644 --- a/bsp/buildroot/package/lighttpd/lighttpd.mk +++ b/bsp/buildroot/package/lighttpd/lighttpd.mk @@ -5,13 +5,15 @@ ################################################################################ LIGHTTPD_VERSION_MAJOR = 1.4 -LIGHTTPD_VERSION = $(LIGHTTPD_VERSION_MAJOR).48 +LIGHTTPD_VERSION = $(LIGHTTPD_VERSION_MAJOR).51 LIGHTTPD_SOURCE = lighttpd-$(LIGHTTPD_VERSION).tar.xz LIGHTTPD_SITE = http://download.lighttpd.net/lighttpd/releases-$(LIGHTTPD_VERSION_MAJOR).x LIGHTTPD_LICENSE = BSD-3-Clause LIGHTTPD_LICENSE_FILES = COPYING LIGHTTPD_DEPENDENCIES = host-pkgconf LIGHTTPD_CONF_OPTS = \ + --without-pam \ + --without-wolfssl \ --libdir=/usr/lib/lighttpd \ --libexecdir=/usr/lib diff --git a/bsp/buildroot/package/linux-headers/Config.in.host b/bsp/buildroot/package/linux-headers/Config.in.host index 8dc8a4cc..7145e957 100644 --- a/bsp/buildroot/package/linux-headers/Config.in.host +++ b/bsp/buildroot/package/linux-headers/Config.in.host @@ -250,12 +250,12 @@ config BR2_DEFAULT_KERNEL_HEADERS string default "3.2.102" if BR2_KERNEL_HEADERS_3_2 default "4.1.52" if BR2_KERNEL_HEADERS_4_1 - default "4.4.158" if BR2_KERNEL_HEADERS_4_4 - default "4.9.129" if BR2_KERNEL_HEADERS_4_9 + default "4.4.164" if BR2_KERNEL_HEADERS_4_4 + default "4.9.140" if BR2_KERNEL_HEADERS_4_9 default "4.10.17" if BR2_KERNEL_HEADERS_4_10 default "4.11.12" if BR2_KERNEL_HEADERS_4_11 default "4.12.14" if BR2_KERNEL_HEADERS_4_12 default "4.13.16" if BR2_KERNEL_HEADERS_4_13 - default "4.14.72" if BR2_KERNEL_HEADERS_4_14 + default "4.14.83" if BR2_KERNEL_HEADERS_4_14 default "4.15.18" if BR2_KERNEL_HEADERS_4_15 default BR2_DEFAULT_KERNEL_VERSION if BR2_KERNEL_HEADERS_VERSION diff --git a/bsp/buildroot/package/live555/0001-Add-a-pkg-config-file-for-the-shared-libraries.patch b/bsp/buildroot/package/live555/0001-Add-a-pkg-config-file-for-the-shared-libraries.patch new file mode 100644 index 00000000..a2ae1c18 --- /dev/null +++ b/bsp/buildroot/package/live555/0001-Add-a-pkg-config-file-for-the-shared-libraries.patch @@ -0,0 +1,66 @@ +From: Benjamin Drung +Date: Sat, 16 Sep 2017 11:22:03 +0200 +Subject: Add a pkg-config file for the shared libraries + +This patch was downloaded from Debian +https://sources.debian.org/src/liblivemedia/2018.08.05-1/debian/patches/0002-Add-a-pkg-config-file-for-the-shared-libraries.patch/ + +The local/ part of PREXIX and LIBDIR was removed to fit into buildroot. + +A similar version of this patch is part of the vlc source repo: +http://git.videolan.org/?p=vlc.git;a=blob;f=contrib/src/live555/add-pkgconfig-file.patch;hb=HEAD + +Upstream status: Rejected +http://lists.live555.com/pipermail/live-devel/2013-January/016374.html +http://lists.live555.com/pipermail/live-devel/2013-January/016375.html + +Signed-off-by: Bernd Kuhls +--- + Makefile.head | 3 +++ + Makefile.tail | 7 ++++++- + live555.pc.in | 9 +++++++++ + 3 files changed, 18 insertions(+), 1 deletion(-) + create mode 100644 live555.pc.in + +diff --git a/Makefile.head b/Makefile.head +index 458c54c..1571037 100644 +--- a/Makefile.head ++++ b/Makefile.head +@@ -1 +1,4 @@ ++PREFIX = /usr ++LIBDIR = /usr/lib ++VERSION = $(shell grep LIVEMEDIA_LIBRARY_VERSION_STRING liveMedia/include/liveMedia_version.hh | sed 's/.*"\([^"]*\)".*/\1/') + ##### Change the following for your environment: +diff --git a/Makefile.tail b/Makefile.tail +index fc594ea..a20a527 100644 +--- a/Makefile.tail ++++ b/Makefile.tail +@@ -22,7 +22,12 @@ all: + @echo + @echo "For more information about this source code (including your obligations under the LGPL), please see our FAQ at http://live555.com/liveMedia/faq.html" + +-install: ++install_shared_libraries: ++ install -d $(DESTDIR)$(LIBDIR)/pkgconfig ++ sed "s#@PREFIX@#$(PREFIX)#;s#@LIBDIR@#$(LIBDIR)#;s#@VERSION@#$(VERSION)#" live555.pc.in > $(DESTDIR)$(LIBDIR)/pkgconfig/live555.pc ++ chmod 644 $(DESTDIR)$(LIBDIR)/pkgconfig/live555.pc ++ ++install: $(INSTALL2) + cd $(LIVEMEDIA_DIR) ; $(MAKE) install + cd $(GROUPSOCK_DIR) ; $(MAKE) install + cd $(USAGE_ENVIRONMENT_DIR) ; $(MAKE) install +diff --git a/live555.pc.in b/live555.pc.in +new file mode 100644 +index 0000000..3736944 +--- /dev/null ++++ b/live555.pc.in +@@ -0,0 +1,9 @@ ++prefix=@PREFIX@ ++libdir=@LIBDIR@ ++includedir=${prefix}/include ++ ++Name: live555 ++Description: multimedia RTSP streaming library ++Version: @VERSION@ ++Cflags: -I${includedir}/liveMedia -I${includedir}/groupsock -I${includedir}/BasicUsageEnvironment -I${includedir}/UsageEnvironment ++Libs: -L${libdir} -lliveMedia -lgroupsock -lBasicUsageEnvironment -lUsageEnvironment diff --git a/bsp/buildroot/package/live555/live555.hash b/bsp/buildroot/package/live555/live555.hash index 66a7b7d7..024dcac1 100644 --- a/bsp/buildroot/package/live555/live555.hash +++ b/bsp/buildroot/package/live555/live555.hash @@ -1,5 +1,5 @@ # From http://live555.com/liveMedia/public/live555-latest-md5.txt -md5 a5acd14c4fa7b50f7270304d3b4a70ae live.2017.10.28.tar.gz +md5 3383dea853735b7a73eda6ddb52b6372 live.2018.10.17.tar.gz # Locally generated -sha256 d8eaec9ded34321aa655d3c9007217dd447218c54cb48c97827e58ecd5edb338 live.2017.10.28.tar.gz +sha256 7c68d9c95b39acd309a2b6a4fc14c3837544a9be3f64062ed38d1ad6f68dc9e8 live.2018.10.17.tar.gz sha256 8ceb4b9ee5adedde47b31e975c1d90c73ad27b6b165a1dcd80c7c545eb65b903 COPYING diff --git a/bsp/buildroot/package/live555/live555.mk b/bsp/buildroot/package/live555/live555.mk index 0507ee9b..6a6d3536 100644 --- a/bsp/buildroot/package/live555/live555.mk +++ b/bsp/buildroot/package/live555/live555.mk @@ -4,7 +4,7 @@ # ################################################################################ -LIVE555_VERSION = 2017.10.28 +LIVE555_VERSION = 2018.10.17 LIVE555_SOURCE = live.$(LIVE555_VERSION).tar.gz LIVE555_SITE = http://www.live555.com/liveMedia/public LIVE555_LICENSE = LGPL-2.1+ diff --git a/bsp/buildroot/package/ljlinenoise/Config.in b/bsp/buildroot/package/ljlinenoise/Config.in index 61c80df0..e6b587e6 100644 --- a/bsp/buildroot/package/ljlinenoise/Config.in +++ b/bsp/buildroot/package/ljlinenoise/Config.in @@ -8,7 +8,7 @@ config BR2_PACKAGE_LJLINENOISE ljlinenoise is a pure LuaJIT port of linenoise, a small alternative to readline and libedit. - http://fperrad.github.io/ljlinenoise/ + https://fperrad.frama.io/ljlinenoise/ comment "ljlinenoise needs LuaJIT" depends on !BR2_PACKAGE_LUAJIT diff --git a/bsp/buildroot/package/lua-curl/0001-Fix-build-with-curl-7.62.0.patch b/bsp/buildroot/package/lua-curl/0001-Fix-build-with-curl-7.62.0.patch new file mode 100644 index 00000000..456afb30 --- /dev/null +++ b/bsp/buildroot/package/lua-curl/0001-Fix-build-with-curl-7.62.0.patch @@ -0,0 +1,58 @@ +From 4e3764ecf2b2c3f62475579fee6af4a753729f07 Mon Sep 17 00:00:00 2001 +From: Baruch Siach +Date: Thu, 1 Nov 2018 19:12:20 +0200 +Subject: [PATCH] Fix build with curl 7.62.0 + +Fixes #134. + +curl 7.62.0 deprecates the CURLE_SSL_CACERT error code, and unifies it +with CURLE_PEER_FAILED_VERIFICATION. Adjust the errors list to match. + +This fixes the following build failure: + +src/lcerr_easy.h: In function 'lcurl_err_easy_mnemo': +src/lcerror.c:32:22: error: duplicate case value + #define ERR_ENTRY(E) case CURLE_##E: return #E; + ^ +src/lcerr_easy.h:74:1: note: in expansion of macro 'ERR_ENTRY' + ERR_ENTRY ( SSL_CACERT ) + ^~~~~~~~~ +src/lcerror.c:32:22: note: previously used here + #define ERR_ENTRY(E) case CURLE_##E: return #E; + ^ +src/lcerr_easy.h:65:1: note: in expansion of macro 'ERR_ENTRY' + ERR_ENTRY ( PEER_FAILED_VERIFICATION ) + ^~~~~~~~~ + +Signed-off-by: Baruch Siach +--- +Upstream status: https://github.com/Lua-cURL/Lua-cURLv3/pull/136 + +diff --git a/src/lcerr_easy.h b/src/lcerr_easy.h +index 94ad143c3bfe..895c6d87d72f 100644 +--- a/Lua-cURLv3-0.3.7/src/lcerr_easy.h ++++ b/Lua-cURLv3-0.3.7/src/lcerr_easy.h +@@ -62,7 +62,11 @@ ERR_ENTRY ( UNKNOWN_TELNET_OPTION ) /* User specified an unknown option */ + #endif + ERR_ENTRY ( TELNET_OPTION_SYNTAX ) + ERR_ENTRY ( OBSOLETE50 ) ++#if LCURL_CURL_VER_GE(7,62,0) ++ERR_ENTRY ( OBSOLETE51 ) ++#else + ERR_ENTRY ( PEER_FAILED_VERIFICATION ) ++#endif + ERR_ENTRY ( GOT_NOTHING ) + ERR_ENTRY ( SSL_ENGINE_NOTFOUND ) + ERR_ENTRY ( SSL_ENGINE_SETFAILED ) +@@ -71,7 +75,11 @@ ERR_ENTRY ( RECV_ERROR ) + ERR_ENTRY ( OBSOLETE57 ) + ERR_ENTRY ( SSL_CERTPROBLEM ) + ERR_ENTRY ( SSL_CIPHER ) ++#if LCURL_CURL_VER_GE(7,62,0) ++ERR_ENTRY ( PEER_FAILED_VERIFICATION ) ++#else + ERR_ENTRY ( SSL_CACERT ) ++#endif + ERR_ENTRY ( BAD_CONTENT_ENCODING ) + ERR_ENTRY ( LDAP_INVALID_URL ) + ERR_ENTRY ( FILESIZE_EXCEEDED ) diff --git a/bsp/buildroot/package/mariadb/mariadb.hash b/bsp/buildroot/package/mariadb/mariadb.hash index e4736465..7730ae0c 100644 --- a/bsp/buildroot/package/mariadb/mariadb.hash +++ b/bsp/buildroot/package/mariadb/mariadb.hash @@ -1,9 +1,9 @@ -# From https://downloads.mariadb.org/mariadb/10.1.35/ -md5 935f401314ff08a4177beb70fed6055c mariadb-10.1.35.tar.gz -sha1 d322f0da17f4de475832dd534657eba5a936f77b mariadb-10.1.35.tar.gz -sha256 9e91d985ed4f662126e3e5791fe91ec8a2f44ec811113c2b6fbc72fa14553c4d mariadb-10.1.35.tar.gz -sha512 88e6049f3bbc3aa047e108f91a2c4f335758e80f25bfa2974b5f8c2e13f5758824d7835dece021b515c531e5641b9998e4de92256ad4b47b7f694da99bd471aa mariadb-10.1.35.tar.gz +# From https://downloads.mariadb.org/mariadb/10.1.37/ +md5 123b37bec63ddca19260e45f0f2276bb mariadb-10.1.37.tar.gz +sha1 35e9c15b5532c2e7c746b1e7452952053d7d5b5a mariadb-10.1.37.tar.gz +sha256 8cd516b0a7f7aa36a7c1d6e687dbbad8c0b08c92d5fd60c6e691b19a6cab4d46 mariadb-10.1.37.tar.gz +sha512 b7c35cd67ad265ce2e3a4db20a2ae2b78745db96dc70a211f027a39b6dbb3dc900991c2ee1021ee6a97d12489c3e2a70252e2adf348a458af38b99c3de5a4f25 mariadb-10.1.37.tar.gz # Hash for license files -sha256 69ce89a0cadbe35a858398c258be93c388715e84fc0ca04e5a1fd1aa9770dd3a README +sha256 d89f09a82da1666d389916bba8c21278d3ef5ac43c2139587234576a128428d4 README sha256 ab15fd526bd8dd18a9e77ebc139656bf4d33e97fc7238cd11bf60e2b9b8666c6 COPYING diff --git a/bsp/buildroot/package/mariadb/mariadb.mk b/bsp/buildroot/package/mariadb/mariadb.mk index 23822187..4e1c4add 100644 --- a/bsp/buildroot/package/mariadb/mariadb.mk +++ b/bsp/buildroot/package/mariadb/mariadb.mk @@ -4,7 +4,7 @@ # ################################################################################ -MARIADB_VERSION = 10.1.35 +MARIADB_VERSION = 10.1.37 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 @@ -48,8 +48,12 @@ MARIADB_CONF_OPTS += -DCMAKE_CROSSCOMPILING=1 MARIADB_CONF_OPTS += -DENABLE_DTRACE=0 ifeq ($(BR2_PACKAGE_MARIADB_SERVER),y) +ifeq ($(BR2_PACKAGE_MARIADB_SERVER_EMBEDDED),y) MARIADB_CONF_OPTS += -DWITH_EMBEDDED_SERVER=ON else +MARIADB_CONF_OPTS += -DWITH_EMBEDDED_SERVER=OFF +endif +else MARIADB_CONF_OPTS += -DWITHOUT_SERVER=ON endif @@ -108,8 +112,6 @@ endif # We also don't need the test suite on the target define MARIADB_POST_INSTALL mkdir -p $(TARGET_DIR)/var/lib/mysql - $(INSTALL) -D -m 644 $(TARGET_DIR)/usr/share/mysql/my-small.cnf \ - $(TARGET_DIR)/etc/mysql/my.cnf $(RM) $(TARGET_DIR)/usr/bin/mysql_config $(RM) -r $(TARGET_DIR)/usr/share/mysql/test endef diff --git a/bsp/buildroot/package/mmc-utils/0002-fix-overlapping-with-strncpy.patch b/bsp/buildroot/package/mmc-utils/0002-fix-overlapping-with-strncpy.patch new file mode 100644 index 00000000..a134dd3c --- /dev/null +++ b/bsp/buildroot/package/mmc-utils/0002-fix-overlapping-with-strncpy.patch @@ -0,0 +1,44 @@ +From 1c90a7534658056b884d71ef82dc7ca8bad4271b Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Cl=C3=A9ment=20P=C3=A9ron?= +Date: Wed, 24 Oct 2018 13:00:47 +0200 +Subject: [PATCH 1/1] mmc-utils: fix overlapping with strncpy +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +GCC 8.2 warns about an overlapping using strncpy. + +Replace strncpy with a memmove to avoid this issue. + +In file included from /usr/include/string.h:494, + from lsmmc.c:46: +In function ‘strncpy’, + inlined from ‘read_file’ at lsmmc.c:356:3: +/usr/include/x86_64-linux-gnu/bits/string_fortified.h:106:10: error: ‘__builtin_strncpy’ accessing 4096 bytes at offsets 0 and 1 overlaps 4095 bytes at offset 1 [-Werror=restrict] + return __builtin___strncpy_chk (__dest, __src, __len, __bos (__dest)); + ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +cc1: all warnings being treated as errors +make: *** [Makefile:36: lsmmc.o] Error 1 + +Signed-off-by: Clément Péron +Signed-off-by: Sébastien Szymanski +--- + lsmmc.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/lsmmc.c b/lsmmc.c +index c4faa00..bcb854d 100644 +--- a/lsmmc.c ++++ b/lsmmc.c +@@ -353,7 +353,7 @@ char *read_file(char *name) + line[strlen(line) - 1] = '\0'; + + while (isspace(line[0])) +- strncpy(&line[0], &line[1], sizeof(line)); ++ memmove(&line[0], &line[1], sizeof(line)-1); + + return strdup(line); + } +-- +2.16.4 + diff --git a/bsp/buildroot/package/mongoose/0001-Fix-body-length-calculation-in-mg_handle_cgi.patch b/bsp/buildroot/package/mongoose/0001-Fix-body-length-calculation-in-mg_handle_cgi.patch new file mode 100644 index 00000000..a6960424 --- /dev/null +++ b/bsp/buildroot/package/mongoose/0001-Fix-body-length-calculation-in-mg_handle_cgi.patch @@ -0,0 +1,46 @@ +From 9e93f71556f8d5ba62fccec46ee5689e385d6d37 Mon Sep 17 00:00:00 2001 +From: Deomid Ryabkov +Date: Mon, 13 Aug 2018 15:50:01 +0300 +Subject: [PATCH] Fix body length calculation in mg_handle_cgi + +Fixes https://nvd.nist.gov/vuln/detail/CVE-2018-10945 + +CL: mg: Fix body length calculation in mg_handle_cgi + +PUBLISHED_FROM=0c30cf36fdb67c75f6148468701e23d6ee72d953 + +[Thomas: backported from upstream commit +f33d3a4e0225d6e009b90193402141025e9ea74d, dropping the changes in +src/mg_http_cgi.c, because back in 6.7, the initial mongoose sources +were not in the tree, only the amalgamated version.] +Signed-off-by: Thomas Petazzoni +--- + mongoose.c | 5 ++--- + 1 file changed, 2 insertions(+), 3 deletions(-) + +diff --git a/mongoose.c b/mongoose.c +index 7e55896..f5b0177 100644 +--- a/mongoose.c ++++ b/mongoose.c +@@ -8308,7 +8308,6 @@ MG_INTERNAL void mg_handle_cgi(struct mg_connection *nc, const char *prog, + + if (mg_start_process(opts->cgi_interpreter, prog, blk.buf, blk.vars, dir, + fds[1]) != 0) { +- size_t n = nc->recv_mbuf.len - (hm->message.len - hm->body.len); + struct mg_connection *cgi_nc = + mg_add_sock(nc->mgr, fds[0], mg_cgi_ev_handler); + struct mg_http_proto_data *cgi_pd = mg_http_get_proto_data(cgi_nc); +@@ -8316,8 +8315,8 @@ MG_INTERNAL void mg_handle_cgi(struct mg_connection *nc, const char *prog, + cgi_pd->cgi.cgi_nc->user_data = nc; + nc->flags |= MG_F_USER_1; + /* Push POST data to the CGI */ +- if (n > 0 && n < nc->recv_mbuf.len) { +- mg_send(cgi_pd->cgi.cgi_nc, hm->body.p, n); ++ if (hm->body.len > 0) { ++ mg_send(cgi_pd->cgi.cgi_nc, hm->body.p, hm->body.len); + } + mbuf_remove(&nc->recv_mbuf, nc->recv_mbuf.len); + } else { +-- +2.14.4 + diff --git a/bsp/buildroot/package/mosquitto/0001-websockets.c-unbreak-build-without-TLS.patch b/bsp/buildroot/package/mosquitto/0001-websockets.c-unbreak-build-without-TLS.patch deleted file mode 100644 index e977fae5..00000000 --- a/bsp/buildroot/package/mosquitto/0001-websockets.c-unbreak-build-without-TLS.patch +++ /dev/null @@ -1,49 +0,0 @@ -From 4822aa97da80a86033ec6e4a8b2f4ad0911235cf Mon Sep 17 00:00:00 2001 -From: Peter Korsgaard -Date: Sat, 3 Mar 2018 11:04:47 +0100 -Subject: [PATCH] websockets.c: unbreak build without TLS - -Commit 7943072b1f3b (Fix use_identity_as_username not working on websockets -clients) added code which unconditionally accesses mosq-ssl, breaking the -build when TLS support is disabled. - -Fix it by guarding this logic inside #ifdef WITH_TLS. - -[Upstream: https://dev.eclipse.org/mhonarc/lists/mosquitto-dev/msg01813.html] -Signed-off-by: Peter Korsgaard ---- - src/websockets.c | 4 ++++ - 1 file changed, 4 insertions(+) - -diff --git a/src/websockets.c b/src/websockets.c -index d4d7961..a796f0a 100644 ---- a/src/websockets.c -+++ b/src/websockets.c -@@ -201,12 +201,14 @@ static int callback_mqtt(struct libwebsocket_context *context, - mosq->ws_context = context; - #endif - mosq->wsi = wsi; -+#ifdef WITH_TLS - if(in){ - mosq->ssl = (SSL *)in; - if(!mosq->listener->ssl_ctx){ - mosq->listener->ssl_ctx = SSL_get_SSL_CTX(mosq->ssl); - } - } -+#endif - u->mosq = mosq; - }else{ - return -1; -@@ -240,7 +242,9 @@ static int callback_mqtt(struct libwebsocket_context *context, - mosq->pollfd_index = -1; - } - mosq->wsi = NULL; -+#ifdef WITH_TLS - mosq->ssl = NULL; -+#endif - do_disconnect(db, mosq); - } - break; --- -2.11.0 - diff --git a/bsp/buildroot/package/mosquitto/mosquitto.hash b/bsp/buildroot/package/mosquitto/mosquitto.hash index 91c855cb..96e2ae93 100644 --- a/bsp/buildroot/package/mosquitto/mosquitto.hash +++ b/bsp/buildroot/package/mosquitto/mosquitto.hash @@ -1,5 +1,5 @@ # Locally calculated after checking gpg signature -sha256 7d3b3e245a3b4ec94b05678c8199c806359737949f4cfe0bf936184f6ca89a83 mosquitto-1.4.15.tar.gz +sha256 5fd7f3454fd6d286645d032bc07f44a1c8583cec02ef2422c9eb32e0a89a9b2f mosquitto-1.5.4.tar.gz # License files sha256 cc77e25bafd40637b7084f04086d606f0a200051b61806f97c93405926670bc1 LICENSE.txt diff --git a/bsp/buildroot/package/mosquitto/mosquitto.mk b/bsp/buildroot/package/mosquitto/mosquitto.mk index ec5fc02f..d01811e5 100644 --- a/bsp/buildroot/package/mosquitto/mosquitto.mk +++ b/bsp/buildroot/package/mosquitto/mosquitto.mk @@ -4,7 +4,7 @@ # ################################################################################ -MOSQUITTO_VERSION = 1.4.15 +MOSQUITTO_VERSION = 1.5.4 MOSQUITTO_SITE = https://mosquitto.org/files/source MOSQUITTO_LICENSE = EPL-1.0 or EDLv1.0 MOSQUITTO_LICENSE_FILES = LICENSE.txt epl-v10 edl-v10 @@ -17,6 +17,13 @@ MOSQUITTO_MAKE_OPTS = \ WITH_WRAP=no \ WITH_DOCS=no +# uses malloc_usable_size which was only added in uClibc-ng 1.0.29 +ifeq ($(BR2_TOOLCHAIN_USES_UCLIBC),y) +MOSQUITTO_MAKE_OPTS += WITH_MEMORY_TRACKING=no +else +MOSQUITTO_MAKE_OPTS += WITH_MEMORY_TRACKING=yes +endif + # adns uses getaddrinfo_a ifeq ($(BR2_TOOLCHAIN_USES_GLIBC),y) MOSQUITTO_MAKE_OPTS += WITH_ADNS=yes diff --git a/bsp/buildroot/package/musl/Config.in b/bsp/buildroot/package/musl/Config.in index bedc50cd..67e9e78a 100644 --- a/bsp/buildroot/package/musl/Config.in +++ b/bsp/buildroot/package/musl/Config.in @@ -4,6 +4,7 @@ config BR2_PACKAGE_MUSL depends on BR2_TOOLCHAIN_USES_MUSL select BR2_PACKAGE_LINUX_HEADERS # SSP broken on i386/ppc: http://www.openwall.com/lists/musl/2016/12/04/2 - select BR2_TOOLCHAIN_HAS_SSP if !(BR2_i386 || BR2_powerpc) + select BR2_TOOLCHAIN_HAS_SSP if BR2_PACKAGE_HOST_BINUTILS_SUPPORTS_CFI \ + && !(BR2_i386 || BR2_powerpc) # Compatibility headers: cdefs.h, queue.h select BR2_PACKAGE_MUSL_COMPAT_HEADERS diff --git a/bsp/buildroot/package/mysql/Config.in b/bsp/buildroot/package/mysql/Config.in index 2abf5dae..b4e49e47 100644 --- a/bsp/buildroot/package/mysql/Config.in +++ b/bsp/buildroot/package/mysql/Config.in @@ -54,6 +54,12 @@ config BR2_PACKAGE_MARIADB_SERVER help Install the mariadb server on the target. +config BR2_PACKAGE_MARIADB_SERVER_EMBEDDED + bool "mariadb embedded server" + depends on BR2_PACKAGE_MARIADB_SERVER + help + Install the mariadb embedded server on the target. + endif if BR2_PACKAGE_ORACLE_MYSQL diff --git a/bsp/buildroot/package/neardal/0001-fix-static-linking-with-libedit-or-readline.patch b/bsp/buildroot/package/neardal/0001-fix-static-linking-with-libedit-or-readline.patch new file mode 100644 index 00000000..bae0edae --- /dev/null +++ b/bsp/buildroot/package/neardal/0001-fix-static-linking-with-libedit-or-readline.patch @@ -0,0 +1,45 @@ +From 62ae1bf0206960d0ba5ff8f90238030e67f1a5cd Mon Sep 17 00:00:00 2001 +From: Fabrice Fontaine +Date: Sun, 28 Oct 2018 20:58:55 +0100 +Subject: [PATCH] fix static linking with libedit or readline + +Use PKG_CHECK_MODULES to find libedit or readline and continue to use +AC_SEARCH_LIBS as a fallback + +By using PKG_CHECK_MODULES, static link will work as -lncurses or -lbsd +will be automatically added + +Signed-off-by: Fabrice Fontaine +[Upstream status: https://github.com/connectivity/neardal/pull/7] +--- + configure.ac | 14 ++++++++++---- + 1 file changed, 10 insertions(+), 4 deletions(-) + +diff --git a/configure.ac b/configure.ac +index f0cebed..211b896 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -68,10 +68,16 @@ PKG_CHECK_MODULES(gio, gio-unix-2.0 >= 2.30, + AC_SUBST([gio_LIBS]), + AC_MSG_ERROR(gio-unix-2.0 >= 2.30 is required)) + +-AC_SEARCH_LIBS([rl_initialize], [edit readline], +- [AS_IF([echo $LIBS | grep -q "-ledit"], +- [CPPFLAGS="-DHAVE_LIBEDIT $CPPFLAGS"])], +- [AC_MSG_ERROR(editline or readline is required)]) ++PKG_CHECK_MODULES(libedit, libedit, ++ [CPPFLAGS="-DHAVE_LIBEDIT $libedit_CFLAGS $CPPFLAGS" ++ LIBS="$libedit_LIBS $LIBS"], ++ [PKG_CHECK_MODULES(readline, readline, ++ [CPPFLAGS="$readline_CFLAGS $CPPFLAGS" ++ LIBS="$readline_LIBS $LIBS"], ++ AC_SEARCH_LIBS([rl_initialize], [edit readline], ++ [AS_IF([echo $LIBS | grep -q "-ledit"], ++ [CPPFLAGS="-DHAVE_LIBEDIT $CPPFLAGS"])], ++ [AC_MSG_ERROR(editline or readline is required)]))]) + + AC_PATH_TOOL([DOXYGEN], [doxygen]) + AM_CONDITIONAL([HAVE_DOXYGEN], [test ! -z "$DOXYGEN"]) +-- +2.17.1 + diff --git a/bsp/buildroot/package/neardal/neardal.mk b/bsp/buildroot/package/neardal/neardal.mk index f3e55fd9..38830119 100644 --- a/bsp/buildroot/package/neardal/neardal.mk +++ b/bsp/buildroot/package/neardal/neardal.mk @@ -21,13 +21,6 @@ else ifeq ($(BR2_PACKAGE_LIBEDIT),y) NEARDAL_DEPENDENCIES += libedit endif -# Both readline and libedit link with ncurses but the configure script -# forgets to take that into account, causing the detection to fail -# when linking statically -ifeq ($(BR2_STATIC_LIBS),y) -NEARDAL_CONF_ENV += LIBS="`$(PKG_CONFIG_HOST_BINARY) --libs ncurses`" -endif - define NEARDAL_INSTALL_NCL $(INSTALL) -m 0755 -D $(@D)/ncl/ncl $(TARGET_DIR)/usr/bin/ncl endef diff --git a/bsp/buildroot/package/netplug/S29netplug b/bsp/buildroot/package/netplug/S29netplug index 66459061..cef0e6a9 100755 --- a/bsp/buildroot/package/netplug/S29netplug +++ b/bsp/buildroot/package/netplug/S29netplug @@ -26,7 +26,7 @@ if [ -f /etc/default/network ]; then . /etc/default/network # Check that networking is up. - [ ${NETWORKING} = "no" ] && exit 0 + [ "${NETWORKING}" = "no" ] && exit 0 elif [ ! -f /etc/network/interfaces ]; then # No network support exit 0 diff --git a/bsp/buildroot/package/netsnmp/0001-configure-Eliminate-the-hard-coded-libnl-3-include-p.patch b/bsp/buildroot/package/netsnmp/0001-configure-Eliminate-the-hard-coded-libnl-3-include-p.patch deleted file mode 100644 index cf059223..00000000 --- a/bsp/buildroot/package/netsnmp/0001-configure-Eliminate-the-hard-coded-libnl-3-include-p.patch +++ /dev/null @@ -1,300 +0,0 @@ -From 57d6c3d36045aab8957ffeb7324728bf17faf8bd Mon Sep 17 00:00:00 2001 -From: Bart Van Assche -Date: Mon, 2 Feb 2015 20:31:29 +0100 -Subject: [PATCH] configure: Eliminate the hard-coded libnl-3 include path - -See also commit 3dde41998625fe0e24119a2e1f4509ba3ba2fd9a. - -(cherry picked from commit 852dcd644cfe4cfc7177649eaec163d6221f2be1) - -Original commit included modifications to configure script. -Do not keep these modifications, since they caused lots of conflicts, and -configure script is meant to be automatically generated. - -Signed-off-by: Julien Floret - -Conflicts: - configure ---- - aclocal.m4 | 1 + - configure.d/config_os_libs2 | 30 ++++++- - m4/pkg.m4 | 214 ++++++++++++++++++++++++++++++++++++++++++++ - 3 files changed, 243 insertions(+), 2 deletions(-) - create mode 100644 m4/pkg.m4 - -diff --git a/aclocal.m4 b/aclocal.m4 -index cd80c7486f2f..45e3608ed480 100644 ---- a/aclocal.m4 -+++ b/aclocal.m4 -@@ -22,3 +22,4 @@ m4_include([m4/ltversion.m4]) - m4_include([m4/lt~obsolete.m4]) - m4_include([m4/netsnmp_arg.m4]) - m4_include([m4/netsnmp_search_libs.m4]) -+m4_include([m4/pkg.m4]) -diff --git a/configure.d/config_os_libs2 b/configure.d/config_os_libs2 -index 47491e24ce0a..10bd414b879e 100644 ---- a/configure.d/config_os_libs2 -+++ b/configure.d/config_os_libs2 -@@ -225,11 +225,37 @@ fi - if test "x$with_nl" != "xno"; then - case $target_os in - linux*) # Check for libnl (linux) -+ # The test below verifies whether the libnl-3 package been installed. -+ # This test works as follows: -+ # - If pkg-config was not installed at the time autogen.sh was run, -+ # the definition of the PKG_CHECK_EXISTS() macro will not be found by -+ # autogen.sh. Augogen.sh will generate a configure script that prints -+ # a warning about pkg-config and proceeds as if libnl-3 has not been -+ # installed. -+ # - If pkg-config was installed at the time autogen.sh was run, -+ # the generated configure script will try to detect the presence of -+ # the libnl-3 library by looking up compile and linker flags in the -+ # file called libnl-3.pc. -+ # - pkg-config settings can be overridden via the configure variables -+ # LIBNL3_CFLAGS and LIBNL3_LIBS (added by the pkg-config m4 macro's to -+ # the configure script -- see also ./configure --help). -+ # - The LIBNL3_CFLAGS and LIBNL3_LIBS configure variables can be used -+ # even if the pkg-config executable is not present on the system on -+ # which the configure script is run. -+ ifdef( -+ [PKG_CHECK_EXISTS], -+ [PKG_CHECK_EXISTS([libnl-3.0], -+ [PKG_CHECK_MODULES([LIBNL3], [libnl-3.0])]) -+ ], -+ AC_MSG_WARN([pkg-config has not been installed or is too old.]) -+ AC_MSG_WARN([Detection of libnl-3.0 will be skipped.]) -+ ) -+ - netsnmp_save_CPPFLAGS="$CPPFLAGS" -- CPPFLAGS="-I/usr/include/libnl3 $CPPFLAGS" -+ CPPFLAGS="${LIBNL3_CFLAGS} $CPPFLAGS" - NETSNMP_SEARCH_LIBS(nl_connect, nl-3, - [AC_CHECK_HEADERS(netlink/netlink.h) -- EXTERNAL_MIBGROUP_INCLUDES="$EXTERNAL_MIBGROUP_INCLUDES -I/usr/include/libnl3"], -+ EXTERNAL_MIBGROUP_INCLUDES="$EXTERNAL_MIBGROUP_INCLUDES ${LIBNL3_CFLAGS}"], - [CPPFLAGS="$netsnmp_save_CPPFLAGS"], [], [], [LMIBLIBS]) - if test "x$ac_cv_header_netlink_netlink_h" != xyes; then - NETSNMP_SEARCH_LIBS(nl_connect, nl, [ -diff --git a/m4/pkg.m4 b/m4/pkg.m4 -new file mode 100644 -index 000000000000..c5b26b52e6cd ---- /dev/null -+++ b/m4/pkg.m4 -@@ -0,0 +1,214 @@ -+# pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*- -+# serial 1 (pkg-config-0.24) -+# -+# Copyright © 2004 Scott James Remnant . -+# -+# This program is free software; you can redistribute it and/or modify -+# it under the terms of the GNU General Public License as published by -+# the Free Software Foundation; either version 2 of the License, or -+# (at your option) any later version. -+# -+# This program is distributed in the hope that it will be useful, but -+# WITHOUT ANY WARRANTY; without even the implied warranty of -+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -+# General Public License for more details. -+# -+# You should have received a copy of the GNU General Public License -+# along with this program; if not, write to the Free Software -+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -+# -+# As a special exception to the GNU General Public License, if you -+# distribute this file as part of a program that contains a -+# configuration script generated by Autoconf, you may include it under -+# the same distribution terms that you use for the rest of that program. -+ -+# PKG_PROG_PKG_CONFIG([MIN-VERSION]) -+# ---------------------------------- -+AC_DEFUN([PKG_PROG_PKG_CONFIG], -+[m4_pattern_forbid([^_?PKG_[A-Z_]+$]) -+m4_pattern_allow([^PKG_CONFIG(_(PATH|LIBDIR|SYSROOT_DIR|ALLOW_SYSTEM_(CFLAGS|LIBS)))?$]) -+m4_pattern_allow([^PKG_CONFIG_(DISABLE_UNINSTALLED|TOP_BUILD_DIR|DEBUG_SPEW)$]) -+AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility]) -+AC_ARG_VAR([PKG_CONFIG_PATH], [directories to add to pkg-config's search path]) -+AC_ARG_VAR([PKG_CONFIG_LIBDIR], [path overriding pkg-config's built-in search path]) -+ -+if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then -+ AC_PATH_TOOL([PKG_CONFIG], [pkg-config]) -+fi -+if test -n "$PKG_CONFIG"; then -+ _pkg_min_version=m4_default([$1], [0.9.0]) -+ AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version]) -+ if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then -+ AC_MSG_RESULT([yes]) -+ else -+ AC_MSG_RESULT([no]) -+ PKG_CONFIG="" -+ fi -+fi[]dnl -+])# PKG_PROG_PKG_CONFIG -+ -+# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) -+# -+# Check to see whether a particular set of modules exists. Similar -+# to PKG_CHECK_MODULES(), but does not set variables or print errors. -+# -+# Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG]) -+# only at the first occurence in configure.ac, so if the first place -+# it's called might be skipped (such as if it is within an "if", you -+# have to call PKG_CHECK_EXISTS manually -+# -------------------------------------------------------------- -+AC_DEFUN([PKG_CHECK_EXISTS], -+[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl -+if test -n "$PKG_CONFIG" && \ -+ AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then -+ m4_default([$2], [:]) -+m4_ifvaln([$3], [else -+ $3])dnl -+fi]) -+ -+# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES]) -+# --------------------------------------------- -+m4_define([_PKG_CONFIG], -+[if test -n "$$1"; then -+ pkg_cv_[]$1="$$1" -+ elif test -n "$PKG_CONFIG"; then -+ PKG_CHECK_EXISTS([$3], -+ [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null` -+ test "x$?" != "x0" && pkg_failed=yes ], -+ [pkg_failed=yes]) -+ else -+ pkg_failed=untried -+fi[]dnl -+])# _PKG_CONFIG -+ -+# _PKG_SHORT_ERRORS_SUPPORTED -+# ----------------------------- -+AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED], -+[AC_REQUIRE([PKG_PROG_PKG_CONFIG]) -+if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then -+ _pkg_short_errors_supported=yes -+else -+ _pkg_short_errors_supported=no -+fi[]dnl -+])# _PKG_SHORT_ERRORS_SUPPORTED -+ -+ -+# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND], -+# [ACTION-IF-NOT-FOUND]) -+# -+# -+# Note that if there is a possibility the first call to -+# PKG_CHECK_MODULES might not happen, you should be sure to include an -+# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac -+# -+# -+# -------------------------------------------------------------- -+AC_DEFUN([PKG_CHECK_MODULES], -+[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl -+AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl -+AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl -+ -+pkg_failed=no -+AC_MSG_CHECKING([for $1]) -+ -+_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2]) -+_PKG_CONFIG([$1][_LIBS], [libs], [$2]) -+ -+m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS -+and $1[]_LIBS to avoid the need to call pkg-config. -+See the pkg-config man page for more details.]) -+ -+if test $pkg_failed = yes; then -+ AC_MSG_RESULT([no]) -+ _PKG_SHORT_ERRORS_SUPPORTED -+ if test $_pkg_short_errors_supported = yes; then -+ $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$2" 2>&1` -+ else -+ $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$2" 2>&1` -+ fi -+ # Put the nasty error message in config.log where it belongs -+ echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD -+ -+ m4_default([$4], [AC_MSG_ERROR( -+[Package requirements ($2) were not met: -+ -+$$1_PKG_ERRORS -+ -+Consider adjusting the PKG_CONFIG_PATH environment variable if you -+installed software in a non-standard prefix. -+ -+_PKG_TEXT])[]dnl -+ ]) -+elif test $pkg_failed = untried; then -+ AC_MSG_RESULT([no]) -+ m4_default([$4], [AC_MSG_FAILURE( -+[The pkg-config script could not be found or is too old. Make sure it -+is in your PATH or set the PKG_CONFIG environment variable to the full -+path to pkg-config. -+ -+_PKG_TEXT -+ -+To get pkg-config, see .])[]dnl -+ ]) -+else -+ $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS -+ $1[]_LIBS=$pkg_cv_[]$1[]_LIBS -+ AC_MSG_RESULT([yes]) -+ $3 -+fi[]dnl -+])# PKG_CHECK_MODULES -+ -+ -+# PKG_INSTALLDIR(DIRECTORY) -+# ------------------------- -+# Substitutes the variable pkgconfigdir as the location where a module -+# should install pkg-config .pc files. By default the directory is -+# $libdir/pkgconfig, but the default can be changed by passing -+# DIRECTORY. The user can override through the --with-pkgconfigdir -+# parameter. -+AC_DEFUN([PKG_INSTALLDIR], -+[m4_pushdef([pkg_default], [m4_default([$1], ['${libdir}/pkgconfig'])]) -+m4_pushdef([pkg_description], -+ [pkg-config installation directory @<:@]pkg_default[@:>@]) -+AC_ARG_WITH([pkgconfigdir], -+ [AS_HELP_STRING([--with-pkgconfigdir], pkg_description)],, -+ [with_pkgconfigdir=]pkg_default) -+AC_SUBST([pkgconfigdir], [$with_pkgconfigdir]) -+m4_popdef([pkg_default]) -+m4_popdef([pkg_description]) -+]) dnl PKG_INSTALLDIR -+ -+ -+# PKG_NOARCH_INSTALLDIR(DIRECTORY) -+# ------------------------- -+# Substitutes the variable noarch_pkgconfigdir as the location where a -+# module should install arch-independent pkg-config .pc files. By -+# default the directory is $datadir/pkgconfig, but the default can be -+# changed by passing DIRECTORY. The user can override through the -+# --with-noarch-pkgconfigdir parameter. -+AC_DEFUN([PKG_NOARCH_INSTALLDIR], -+[m4_pushdef([pkg_default], [m4_default([$1], ['${datadir}/pkgconfig'])]) -+m4_pushdef([pkg_description], -+ [pkg-config arch-independent installation directory @<:@]pkg_default[@:>@]) -+AC_ARG_WITH([noarch-pkgconfigdir], -+ [AS_HELP_STRING([--with-noarch-pkgconfigdir], pkg_description)],, -+ [with_noarch_pkgconfigdir=]pkg_default) -+AC_SUBST([noarch_pkgconfigdir], [$with_noarch_pkgconfigdir]) -+m4_popdef([pkg_default]) -+m4_popdef([pkg_description]) -+]) dnl PKG_NOARCH_INSTALLDIR -+ -+ -+# PKG_CHECK_VAR(VARIABLE, MODULE, CONFIG-VARIABLE, -+# [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) -+# ------------------------------------------- -+# Retrieves the value of the pkg-config variable for the given module. -+AC_DEFUN([PKG_CHECK_VAR], -+[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl -+AC_ARG_VAR([$1], [value of $3 for $2, overriding pkg-config])dnl -+ -+_PKG_CONFIG([$1], [variable="][$3]["], [$2]) -+AS_VAR_COPY([$1], [pkg_cv_][$1]) -+ -+AS_VAR_IF([$1], [""], [$5], [$4])dnl -+])# PKG_CHECK_VAR --- -2.1.0 - diff --git a/bsp/buildroot/package/netsnmp/0001-configure-static-linking-Fix-SSL-checks.patch b/bsp/buildroot/package/netsnmp/0001-configure-static-linking-Fix-SSL-checks.patch new file mode 100644 index 00000000..8431d468 --- /dev/null +++ b/bsp/buildroot/package/netsnmp/0001-configure-static-linking-Fix-SSL-checks.patch @@ -0,0 +1,142 @@ +From bd59be8e4e339870a1400f6866a7b73ca11f6460 Mon Sep 17 00:00:00 2001 +From: Giulio Benetti +Date: Wed, 12 Sep 2018 20:16:39 +0200 +Subject: [PATCH 1/3] configure, static linking: Fix SSL checks + +During checking of DTLS_method, the stub program is linked only with -ssl +libssl.a lacks some function from -lcrypto: +RAND_*() +ERR_*() +BUF_MEM_*() +etc. +and -lz: +- inflate() +- deflate() + +Append -lcrypto and -lz to LIBS variable when checking DTLS_method. + +See also https://sourceforge.net/p/net-snmp/patches/1374/. + +Signed-off-by: Giulio Benetti +[bvanassche: Edited subject / rewrote this patch] +--- + configure | 52 ++++++++++++++++++++++++++++++++++--- + configure.d/config_os_libs2 | 14 +++++++--- + 2 files changed, 58 insertions(+), 8 deletions(-) + +diff --git a/configure b/configure +index 6504a8e58..1116cecaa 100755 +--- a/configure ++++ b/configure +@@ -23228,16 +23228,60 @@ fi + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_EVP_md5" >&5 + $as_echo "$ac_cv_lib_crypto_EVP_md5" >&6; } + if test "x$ac_cv_lib_crypto_EVP_md5" = xyes; then : +- CRYPTO="crypto" ++ CRYPTO="crypto"; LIBCRYPTO="-lcrypto" ++else ++ ++ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for EVP_md5 in -lcrypto" >&5 ++$as_echo_n "checking for EVP_md5 in -lcrypto... " >&6; } ++if ${ac_cv_lib_crypto_EVP_md5+:} false; then : ++ $as_echo_n "(cached) " >&6 ++else ++ ac_check_lib_save_LIBS=$LIBS ++LIBS="-lcrypto -lz $LIBS" ++cat confdefs.h - <<_ACEOF >conftest.$ac_ext ++/* end confdefs.h. */ ++ ++/* Override any GCC internal prototype to avoid an error. ++ Use char because int might match the return type of a GCC ++ builtin and then its argument prototype would still apply. */ ++#ifdef __cplusplus ++extern "C" ++#endif ++char EVP_md5 (); ++int ++main () ++{ ++return EVP_md5 (); ++ ; ++ return 0; ++} ++_ACEOF ++if ac_fn_c_try_link "$LINENO"; then : ++ ac_cv_lib_crypto_EVP_md5=yes ++else ++ ac_cv_lib_crypto_EVP_md5=no ++fi ++rm -f core conftest.err conftest.$ac_objext \ ++ conftest$ac_exeext conftest.$ac_ext ++LIBS=$ac_check_lib_save_LIBS ++fi ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_EVP_md5" >&5 ++$as_echo "$ac_cv_lib_crypto_EVP_md5" >&6; } ++if test "x$ac_cv_lib_crypto_EVP_md5" = xyes; then : ++ CRYPTO="crypto"; LIBCRYPTO="-lcrypto -lz" + fi + +- fi ++ ++fi ++ ++ else ++ LIBCRYPTO="-l${CRYPTO}" ++ fi + + if test x$CRYPTO != x; then + + $as_echo "#define HAVE_LIBCRYPTO 1" >>confdefs.h + +- LIBCRYPTO="-l${CRYPTO}" + netsnmp_save_LIBS="$LIBS" + LIBS="$LIBCRYPTO" + for ac_func in AES_cfb128_encrypt EVP_sha224 EVP_sha384 EVP_MD_CTX_create EVP_MD_CTX_destroy EVP_MD_CTX_new EVP_MD_CTX_free DH_set0_pqg DH_get0_pqg DH_get0_key ASN1_STRING_get0_data X509_NAME_ENTRY_get_object X509_NAME_ENTRY_get_data X509_get_signature_nid +@@ -23291,7 +23335,7 @@ _ACEOF + LIBS="$netsnmp_save_LIBS" + fi + netsnmp_save_LIBS="$LIBS" +- LIBS="-lssl" ++ LIBS="-lssl $LIBCRYPTO" + for ac_func in TLS_method TLSv1_method DTLS_method DTLSv1_method SSL_library_init SSL_load_error_strings + do : + as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +diff --git a/configure.d/config_os_libs2 b/configure.d/config_os_libs2 +index 4a1ad1551..75214cfff 100644 +--- a/configure.d/config_os_libs2 ++++ b/configure.d/config_os_libs2 +@@ -306,13 +306,19 @@ if test "x$tryopenssl" != "xno" -a "x$tryopenssl" != "xinternal"; then + LIBS="$netsnmp_save_LIBS" + + if test x$CRYPTO = x; then +- AC_CHECK_LIB([crypto], [EVP_md5], [CRYPTO="crypto"]) +- fi ++ AC_CHECK_LIB([crypto], [EVP_md5], ++ [CRYPTO="crypto"; LIBCRYPTO="-lcrypto"], [ ++ AC_CHECK_LIB([crypto], [EVP_md5], ++ [CRYPTO="crypto"; LIBCRYPTO="-lcrypto -lz"], [], ++ [-lz]) ++ ]) ++ else ++ LIBCRYPTO="-l${CRYPTO}" ++ fi + + if test x$CRYPTO != x; then + AC_DEFINE(HAVE_LIBCRYPTO, 1, + [Define to 1 if you have the OpenSSL library (-lcrypto or -leay32).]) +- LIBCRYPTO="-l${CRYPTO}" + netsnmp_save_LIBS="$LIBS" + LIBS="$LIBCRYPTO" + AC_CHECK_FUNCS([AES_cfb128_encrypt]dnl +@@ -342,7 +348,7 @@ if test "x$tryopenssl" != "xno" -a "x$tryopenssl" != "xinternal"; then + LIBS="$netsnmp_save_LIBS" + fi + netsnmp_save_LIBS="$LIBS" +- LIBS="-lssl" ++ LIBS="-lssl $LIBCRYPTO" + AC_CHECK_FUNCS([TLS_method TLSv1_method DTLS_method DTLSv1_method]dnl + [SSL_library_init SSL_load_error_strings]) + LIBS="$netsnmp_save_LIBS" +-- +2.17.1 + diff --git a/bsp/buildroot/package/netsnmp/0002-configure-Fix-lcrypto-lz-test.patch b/bsp/buildroot/package/netsnmp/0002-configure-Fix-lcrypto-lz-test.patch new file mode 100644 index 00000000..3ec0c227 --- /dev/null +++ b/bsp/buildroot/package/netsnmp/0002-configure-Fix-lcrypto-lz-test.patch @@ -0,0 +1,41 @@ +From d8694929b12b47febb0f7f43f46041387874fe52 Mon Sep 17 00:00:00 2001 +From: Bart Van Assche +Date: Mon, 17 Sep 2018 07:33:34 -0700 +Subject: [PATCH 2/3] configure: Fix -lcrypto -lz test + +Avoid that the second crypto library test uses the cached result from +the first test by explicitly clearing the cached test result. + +Signed-off-by: Giulio Benetti +--- + configure | 1 + + configure.d/config_os_libs2 | 1 + + 2 files changed, 2 insertions(+) + +diff --git a/configure b/configure +index 1116cecaa..33b8c93e5 100755 +--- a/configure ++++ b/configure +@@ -23231,6 +23231,7 @@ if test "x$ac_cv_lib_crypto_EVP_md5" = xyes; then : + CRYPTO="crypto"; LIBCRYPTO="-lcrypto" + else + ++ unset ac_cv_lib_crypto_EVP_md5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for EVP_md5 in -lcrypto" >&5 + $as_echo_n "checking for EVP_md5 in -lcrypto... " >&6; } + if ${ac_cv_lib_crypto_EVP_md5+:} false; then : +diff --git a/configure.d/config_os_libs2 b/configure.d/config_os_libs2 +index 75214cfff..81788a209 100644 +--- a/configure.d/config_os_libs2 ++++ b/configure.d/config_os_libs2 +@@ -308,6 +308,7 @@ if test "x$tryopenssl" != "xno" -a "x$tryopenssl" != "xinternal"; then + if test x$CRYPTO = x; then + AC_CHECK_LIB([crypto], [EVP_md5], + [CRYPTO="crypto"; LIBCRYPTO="-lcrypto"], [ ++ unset ac_cv_lib_crypto_EVP_md5 + AC_CHECK_LIB([crypto], [EVP_md5], + [CRYPTO="crypto"; LIBCRYPTO="-lcrypto -lz"], [], + [-lz]) +-- +2.17.1 + diff --git a/bsp/buildroot/package/netsnmp/0003-configure-fix-AC_CHECK_FUNCS-EVP_sha224-EVP_sha384-..patch b/bsp/buildroot/package/netsnmp/0003-configure-fix-AC_CHECK_FUNCS-EVP_sha224-EVP_sha384-..patch new file mode 100644 index 00000000..08290421 --- /dev/null +++ b/bsp/buildroot/package/netsnmp/0003-configure-fix-AC_CHECK_FUNCS-EVP_sha224-EVP_sha384-..patch @@ -0,0 +1,39 @@ +From 8e273c688aa235ed9c68570a700d31596bac14df Mon Sep 17 00:00:00 2001 +From: Giulio Benetti +Date: Mon, 15 Oct 2018 19:07:05 +0200 +Subject: [PATCH 1/2] configure: fix AC_CHECK_FUNCS(EVP_sha224 EVP_sha384 ...) + failure on static linking + +If building as static lib, AC_CHECK_FUNCS(EVP_sha224 EVP_sha384 ...) +fails due to missing -lz in $LIBS. +At the moment, $LIBS contains $LIBCRYPTO only discarding previous $LIBS +content. + +Add $LIBS to: +LIBS="$LIBCRYPTO" +as: +LIBS="$LIBCRYPTO $LIBS" +This way $LIBS will contain -lz at the end of linking command that in +static linking build is mandatory. + +Signed-off-by: Giulio Benetti +--- + configure.d/config_os_libs2 | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/configure.d/config_os_libs2 b/configure.d/config_os_libs2 +index 81788a209..93044000b 100644 +--- a/configure.d/config_os_libs2 ++++ b/configure.d/config_os_libs2 +@@ -321,7 +321,7 @@ if test "x$tryopenssl" != "xno" -a "x$tryopenssl" != "xinternal"; then + AC_DEFINE(HAVE_LIBCRYPTO, 1, + [Define to 1 if you have the OpenSSL library (-lcrypto or -leay32).]) + netsnmp_save_LIBS="$LIBS" +- LIBS="$LIBCRYPTO" ++ LIBS="$LIBCRYPTO $LIBS" + AC_CHECK_FUNCS([AES_cfb128_encrypt]dnl + [EVP_sha224 EVP_sha384 ]dnl + [EVP_MD_CTX_create EVP_MD_CTX_destroy]dnl +-- +2.17.1 + diff --git a/bsp/buildroot/package/netsnmp/0004-configure-fix-AC_CHECK_FUNCS-TLS_method-TLSv1_method.patch b/bsp/buildroot/package/netsnmp/0004-configure-fix-AC_CHECK_FUNCS-TLS_method-TLSv1_method.patch new file mode 100644 index 00000000..a731f257 --- /dev/null +++ b/bsp/buildroot/package/netsnmp/0004-configure-fix-AC_CHECK_FUNCS-TLS_method-TLSv1_method.patch @@ -0,0 +1,39 @@ +From 1ab6e3fc3cf61fa5a7b7363e59095e868474524b Mon Sep 17 00:00:00 2001 +From: Giulio Benetti +Date: Mon, 15 Oct 2018 19:34:26 +0200 +Subject: [PATCH 2/2] configure: fix AC_CHECK_FUNCS(TLS_method TLSv1_method + ...) failure on static linking + +If building as static lib, AC_CHECK_FUNCS(TLS_method TLSv1_method ...) +fails due to missing -lz in $LIBS. +At the moment, $LIBS contains "-lssl $LIBCRYPTO" only discarding +previous $LIBS content. + +Add $LIBS to: +LIBS="-lssl $LIBCRYPTO" +as: +LIBS="-lssl $LIBCRYPTO $LIBS" +This way $LIBS will contain -lz at the end of linking command that in +static linking build is mandatory. + +Signed-off-by: Giulio Benetti +--- + configure.d/config_os_libs2 | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/configure.d/config_os_libs2 b/configure.d/config_os_libs2 +index 93044000b..c811c63ec 100644 +--- a/configure.d/config_os_libs2 ++++ b/configure.d/config_os_libs2 +@@ -349,7 +349,7 @@ if test "x$tryopenssl" != "xno" -a "x$tryopenssl" != "xinternal"; then + LIBS="$netsnmp_save_LIBS" + fi + netsnmp_save_LIBS="$LIBS" +- LIBS="-lssl $LIBCRYPTO" ++ LIBS="-lssl $LIBCRYPTO $LIBS" + AC_CHECK_FUNCS([TLS_method TLSv1_method DTLS_method DTLSv1_method]dnl + [SSL_library_init SSL_load_error_strings]) + LIBS="$netsnmp_save_LIBS" +-- +2.17.1 + diff --git a/bsp/buildroot/package/netsnmp/netsnmp.hash b/bsp/buildroot/package/netsnmp/netsnmp.hash index fc779260..d05a7de9 100644 --- a/bsp/buildroot/package/netsnmp/netsnmp.hash +++ b/bsp/buildroot/package/netsnmp/netsnmp.hash @@ -1,3 +1,6 @@ -# From http://sourceforge.net/projects/net-snmp/files/net-snmp/5.7.3/ -md5 d4a3459e1577d0efa8d96ca70a885e53 net-snmp-5.7.3.tar.gz -sha1 97dc25077257680815de44e34128d365c76bd839 net-snmp-5.7.3.tar.gz +# From http://sourceforge.net/projects/net-snmp/files/net-snmp/5.8/ +md5 63bfc65fbb86cdb616598df1aff6458a net-snmp-5.8.tar.gz +sha1 78f70731df9dcdb13fe8f60eb7d80d7583da4d2c net-snmp-5.8.tar.gz +# Locally computed +sha256 b2fc3500840ebe532734c4786b0da4ef0a5f67e51ef4c86b3345d697e4976adf net-snmp-5.8.tar.gz +sha256 ed869ea395a1f125819a56676385ab0557a21507764bf56f2943302011381e59 COPYING diff --git a/bsp/buildroot/package/netsnmp/netsnmp.mk b/bsp/buildroot/package/netsnmp/netsnmp.mk index 742fa6e3..65a3f16a 100644 --- a/bsp/buildroot/package/netsnmp/netsnmp.mk +++ b/bsp/buildroot/package/netsnmp/netsnmp.mk @@ -4,8 +4,8 @@ # ################################################################################ -NETSNMP_VERSION = 5.7.3 -NETSNMP_SITE = http://downloads.sourceforge.net/project/net-snmp/net-snmp/$(NETSNMP_VERSION) +NETSNMP_VERSION = 5.8 +NETSNMP_SITE = https://downloads.sourceforge.net/project/net-snmp/net-snmp/$(NETSNMP_VERSION) NETSNMP_SOURCE = net-snmp-$(NETSNMP_VERSION).tar.gz NETSNMP_LICENSE = Various BSD-like NETSNMP_LICENSE_FILES = COPYING diff --git a/bsp/buildroot/package/network-manager/0001-dhcp6-make-sure-we-have-enough-space-for-the-DHCP6-o.patch b/bsp/buildroot/package/network-manager/0001-dhcp6-make-sure-we-have-enough-space-for-the-DHCP6-o.patch new file mode 100644 index 00000000..c6066abe --- /dev/null +++ b/bsp/buildroot/package/network-manager/0001-dhcp6-make-sure-we-have-enough-space-for-the-DHCP6-o.patch @@ -0,0 +1,38 @@ +From 01ca2053bbea09f35b958c8cc7631e15469acb79 Mon Sep 17 00:00:00 2001 +From: Lennart Poettering +Date: Fri, 19 Oct 2018 12:12:33 +0200 +Subject: dhcp6: make sure we have enough space for the DHCP6 option header + +Fixes a vulnerability originally discovered by Felix Wilhelm from +Google. + +CVE-2018-15688 +LP: #1795921 +https://bugzilla.redhat.com/show_bug.cgi?id=1639067 + +(cherry picked from commit 4dac5eaba4e419b29c97da38a8b1f82336c2c892) + +Patch downloaded from upstream commit: +https://cgit.freedesktop.org/NetworkManager/NetworkManager/commit/?id=01ca2053bbea09f35b958c8cc7631e15469acb79 + +Signed-off-by: Bernd Kuhls +--- + src/systemd/src/libsystemd-network/dhcp6-option.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/systemd/src/libsystemd-network/dhcp6-option.c b/src/systemd/src/libsystemd-network/dhcp6-option.c +index d178fe2..9027c14 100644 +--- a/src/systemd/src/libsystemd-network/dhcp6-option.c ++++ b/src/systemd/src/libsystemd-network/dhcp6-option.c +@@ -108,7 +108,7 @@ int dhcp6_option_append_ia(uint8_t **buf, size_t *buflen, const DHCP6IA *ia) { + return -EINVAL; + } + +- if (*buflen < len) ++ if (*buflen < offsetof(DHCP6Option, data) + len) + return -ENOBUFS; + + ia_hdr = *buf; +-- +cgit v1.1 + diff --git a/bsp/buildroot/package/nfs-utils/0006-Include-sys-sysmacros.h-where-appropriate.patch b/bsp/buildroot/package/nfs-utils/0006-Include-sys-sysmacros.h-where-appropriate.patch new file mode 100644 index 00000000..a593ca3b --- /dev/null +++ b/bsp/buildroot/package/nfs-utils/0006-Include-sys-sysmacros.h-where-appropriate.patch @@ -0,0 +1,50 @@ +From e3918d70b0b4a1d0f5421318e542ec807833da3f Mon Sep 17 00:00:00 2001 +From: Thomas Petazzoni +Date: Fri, 2 Nov 2018 10:45:21 +0100 +Subject: [PATCH] Include where appropriate + +Since glibc 2.28, the major() and minor() macros need to explicitly +include . + +Patch initially contributed by +Timothy Pearson . + +Signed-off-by: Thomas Petazzoni +--- + support/nfs/nfsexport.c | 4 ++++ + utils/mountd/cache.c | 4 ++++ + 2 files changed, 8 insertions(+) + +diff --git a/support/nfs/nfsexport.c b/support/nfs/nfsexport.c +index afd7c90..a7cbc14 100644 +--- a/support/nfs/nfsexport.c ++++ b/support/nfs/nfsexport.c +@@ -17,6 +17,10 @@ + #include + #include + ++#ifdef __GLIBC__ ++#include ++#endif ++ + #include "nfslib.h" + #include "misc.h" + +diff --git a/utils/mountd/cache.c b/utils/mountd/cache.c +index 179ea18..61f9b14 100644 +--- a/utils/mountd/cache.c ++++ b/utils/mountd/cache.c +@@ -36,6 +36,10 @@ + #include "blkid/blkid.h" + #endif + ++#ifdef __GLIBC__ ++#include ++#endif ++ + /* + * Invoked by RPC service loop + */ +-- +2.14.4 + diff --git a/bsp/buildroot/package/nginx/0003-auto-set-ngx_feature_run_force_result-for-each-featu.patch b/bsp/buildroot/package/nginx/0003-auto-set-ngx_feature_run_force_result-for-each-featu.patch index be1df7fb..f186becd 100644 --- a/bsp/buildroot/package/nginx/0003-auto-set-ngx_feature_run_force_result-for-each-featu.patch +++ b/bsp/buildroot/package/nginx/0003-auto-set-ngx_feature_run_force_result-for-each-featu.patch @@ -1,4 +1,4 @@ -From 71939b727a8fa9f722934700948a5b68960f6183 Mon Sep 17 00:00:00 2001 +From 57d9d632be9a9f7e3ac00f9eb10b069afd0b1543 Mon Sep 17 00:00:00 2001 From: Samuel Martin Date: Thu, 29 May 2014 18:52:10 +0200 Subject: [PATCH] auto/*: set ngx_feature_run_force_result for each feature @@ -25,18 +25,18 @@ Signed-off-by: Danomi Manchego 6 files changed, 20 insertions(+) diff --git a/auto/cc/conf b/auto/cc/conf -index edc6d74..a61ade4 100644 +index afbca62b..ad42c800 100644 --- a/auto/cc/conf +++ b/auto/cc/conf -@@ -181,6 +181,7 @@ if [ "$NGX_PLATFORM" != win32 ]; then - ngx_feature="gcc builtin atomic operations" - ngx_feature_name=NGX_HAVE_GCC_ATOMIC - ngx_feature_run=yes -+ ngx_feature_run_force_result="$ngx_force_gcc_have_atomic" - ngx_feature_incs= - ngx_feature_path= - ngx_feature_libs= -@@ -201,6 +203,7 @@ if [ "$NGX_PLATFORM" != win32 ]; then +@@ -184,6 +184,7 @@ if [ "$NGX_PLATFORM" != win32 ]; then + ngx_feature="gcc builtin atomic operations" + ngx_feature_name=NGX_HAVE_GCC_ATOMIC + ngx_feature_run=yes ++ ngx_feature_run_force_result="$ngx_force_gcc_have_atomic" + ngx_feature_incs= + ngx_feature_path= + ngx_feature_libs= +@@ -205,6 +206,7 @@ if [ "$NGX_PLATFORM" != win32 ]; then ngx_feature="C99 variadic macros" ngx_feature_name="NGX_HAVE_C99_VARIADIC_MACROS" ngx_feature_run=yes @@ -44,7 +44,7 @@ index edc6d74..a61ade4 100644 ngx_feature_incs="#include #define var(dummy, ...) sprintf(__VA_ARGS__)" ngx_feature_path= -@@ -215,6 +220,7 @@ if [ "$NGX_PLATFORM" != win32 ]; then +@@ -219,6 +221,7 @@ if [ "$NGX_PLATFORM" != win32 ]; then ngx_feature="gcc variadic macros" ngx_feature_name="NGX_HAVE_GCC_VARIADIC_MACROS" ngx_feature_run=yes @@ -53,7 +53,7 @@ index edc6d74..a61ade4 100644 #define var(dummy, args...) sprintf(args)" ngx_feature_path= diff --git a/auto/cc/name b/auto/cc/name -index 51a7ed9..d237d47 100644 +index ded93f5b..7c3cb74a 100644 --- a/auto/cc/name +++ b/auto/cc/name @@ -8,6 +8,7 @@ if [ "$NGX_PLATFORM" != win32 ]; then @@ -65,7 +65,7 @@ index 51a7ed9..d237d47 100644 ngx_feature_path= ngx_feature_libs= diff --git a/auto/lib/libatomic/conf b/auto/lib/libatomic/conf -index d1e484a..3724916 100644 +index d1e484ab..37249161 100644 --- a/auto/lib/libatomic/conf +++ b/auto/lib/libatomic/conf @@ -15,6 +15,7 @@ else @@ -77,10 +77,10 @@ index d1e484a..3724916 100644 #include " ngx_feature_path= diff --git a/auto/os/darwin b/auto/os/darwin -index 1d3e3d3..11b7276 100644 +index 429468f7..1ed47cca 100644 --- a/auto/os/darwin +++ b/auto/os/darwin -@@ -30,6 +30,7 @@ NGX_KQUEUE_CHECKED=YES +@@ -33,6 +33,7 @@ NGX_KQUEUE_CHECKED=YES ngx_feature="kqueue's EVFILT_TIMER" ngx_feature_name="NGX_HAVE_TIMER_EVENT" ngx_feature_run=yes @@ -88,7 +88,7 @@ index 1d3e3d3..11b7276 100644 ngx_feature_incs="#include #include " ngx_feature_path= -@@ -60,6 +61,7 @@ ngx_feature_test="int kq; +@@ -63,6 +64,7 @@ ngx_feature_test="int kq; ngx_feature="Darwin 64-bit kqueue millisecond timeout bug" ngx_feature_name=NGX_DARWIN_KEVENT_BUG ngx_feature_run=bug @@ -96,7 +96,7 @@ index 1d3e3d3..11b7276 100644 ngx_feature_incs="#include #include " ngx_feature_path= -@@ -90,6 +92,7 @@ CC_AUX_FLAGS="$CC_AUX_FLAGS" +@@ -92,6 +94,7 @@ ngx_feature_test="int kq; ngx_feature="sendfile()" ngx_feature_name="NGX_HAVE_SENDFILE" ngx_feature_run=yes @@ -105,7 +105,7 @@ index 1d3e3d3..11b7276 100644 #include #include diff --git a/auto/os/linux b/auto/os/linux -index 19bf832..16848b2 100644 +index 2c8a9bb8..eb4513ee 100644 --- a/auto/os/linux +++ b/auto/os/linux @@ -37,6 +37,7 @@ fi @@ -141,7 +141,7 @@ index 19bf832..16848b2 100644 ngx_feature_path= ngx_feature_libs= diff --git a/auto/unix b/auto/unix -index 6e54531..7dbf9d1 100755 +index 43d3b25a..3da00537 100644 --- a/auto/unix +++ b/auto/unix @@ -100,6 +100,7 @@ if test -z "$NGX_KQUEUE_CHECKED"; then @@ -152,7 +152,7 @@ index 6e54531..7dbf9d1 100755 ngx_feature_incs="#include #include " ngx_feature_path= -@@ -702,6 +703,7 @@ ngx_feature_test="char buf[1]; ssize_t n; n = pwrite(1, buf, 1, 0); +@@ -730,6 +731,7 @@ ngx_feature_test="char buf[1]; struct iovec vec[1]; ssize_t n; ngx_feature="sys_nerr" ngx_feature_name="NGX_SYS_NERR" ngx_feature_run=value @@ -160,7 +160,7 @@ index 6e54531..7dbf9d1 100755 ngx_feature_incs='#include #include ' ngx_feature_path= -@@ -716,6 +718,7 @@ if [ $ngx_found = no ]; then +@@ -744,6 +746,7 @@ if [ $ngx_found = no ]; then ngx_feature="_sys_nerr" ngx_feature_name="NGX_SYS_NERR" ngx_feature_run=value @@ -168,7 +168,7 @@ index 6e54531..7dbf9d1 100755 ngx_feature_incs='#include #include ' ngx_feature_path= -@@ -731,6 +734,7 @@ if [ $ngx_found = no ]; then +@@ -759,6 +762,7 @@ if [ $ngx_found = no ]; then ngx_feature='maximum errno' ngx_feature_name=NGX_SYS_NERR ngx_feature_run=value @@ -176,7 +176,7 @@ index 6e54531..7dbf9d1 100755 ngx_feature_incs='#include #include #include ' -@@ -789,6 +793,7 @@ ngx_feature_test="void *p; p = memalign(4096, 4096); +@@ -841,6 +845,7 @@ ngx_feature_test="void *p; p = memalign(4096, 4096); ngx_feature="mmap(MAP_ANON|MAP_SHARED)" ngx_feature_name="NGX_HAVE_MAP_ANON" ngx_feature_run=yes @@ -184,7 +184,7 @@ index 6e54531..7dbf9d1 100755 ngx_feature_incs="#include " ngx_feature_path= ngx_feature_libs= -@@ -802,6 +807,7 @@ ngx_feature_test="void *p; +@@ -854,6 +859,7 @@ ngx_feature_test="void *p; ngx_feature='mmap("/dev/zero", MAP_SHARED)' ngx_feature_name="NGX_HAVE_MAP_DEVZERO" ngx_feature_run=yes @@ -192,7 +192,7 @@ index 6e54531..7dbf9d1 100755 ngx_feature_incs="#include #include #include " -@@ -817,6 +823,7 @@ ngx_feature_test='void *p; int fd; +@@ -869,6 +875,7 @@ ngx_feature_test='void *p; int fd; ngx_feature="System V shared memory" ngx_feature_name="NGX_HAVE_SYSVSHM" ngx_feature_run=yes @@ -200,7 +200,7 @@ index 6e54531..7dbf9d1 100755 ngx_feature_incs="#include #include " ngx_feature_path= -@@ -831,6 +838,7 @@ ngx_feature_test="int id; +@@ -883,6 +890,7 @@ ngx_feature_test="int id; ngx_feature="POSIX semaphores" ngx_feature_name="NGX_HAVE_POSIX_SEM" ngx_feature_run=yes @@ -209,5 +209,5 @@ index 6e54531..7dbf9d1 100755 ngx_feature_path= ngx_feature_libs= -- -1.9.1 +2.17.1 diff --git a/bsp/buildroot/package/nginx/0004-auto-lib-libxslt-conf-use-pkg-config.patch b/bsp/buildroot/package/nginx/0004-auto-lib-libxslt-conf-use-pkg-config.patch index 103f90b3..09e708b7 100644 --- a/bsp/buildroot/package/nginx/0004-auto-lib-libxslt-conf-use-pkg-config.patch +++ b/bsp/buildroot/package/nginx/0004-auto-lib-libxslt-conf-use-pkg-config.patch @@ -1,4 +1,4 @@ -From 211b9f19a3a62826fadef55d2f89d6f66fbf4aa6 Mon Sep 17 00:00:00 2001 +From 7783d63c87f94797aa134786214b0a84c000be75 Mon Sep 17 00:00:00 2001 From: Samuel Martin Date: Thu, 29 May 2014 19:22:27 +0200 Subject: [PATCH] auto/lib/libxslt/conf: use pkg-config @@ -7,12 +7,14 @@ Change to using pkg-config to find the path to libxslt and its dependencies. Signed-off-by: Martin Bark +[Peter: updated for 1.15.6] +Signed-off-by: Peter Korsgaard --- - auto/lib/libxslt/conf | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) + auto/lib/libxslt/conf | 5 +++-- + 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/auto/lib/libxslt/conf b/auto/lib/libxslt/conf -index 3a0f37b..3c2a60e 100644 +index 3063ac7c..3209e364 100644 --- a/auto/lib/libxslt/conf +++ b/auto/lib/libxslt/conf @@ -12,8 +12,9 @@ @@ -26,7 +28,7 @@ index 3a0f37b..3c2a60e 100644 + ngx_feature_libs="$(${PKG_CONFIG:=pkg-config} --libs libxslt)" ngx_feature_test="xmlParserCtxtPtr ctxt = NULL; xsltStylesheetPtr sheet = NULL; - xmlDocPtr doc; + xmlDocPtr doc = NULL; -- -2.8.2 +2.11.0 diff --git a/bsp/buildroot/package/nginx/0006-auto-lib-openssl-conf-use-pkg-config.patch b/bsp/buildroot/package/nginx/0006-auto-lib-openssl-conf-use-pkg-config.patch index 0bd4d337..43387296 100644 --- a/bsp/buildroot/package/nginx/0006-auto-lib-openssl-conf-use-pkg-config.patch +++ b/bsp/buildroot/package/nginx/0006-auto-lib-openssl-conf-use-pkg-config.patch @@ -1,4 +1,4 @@ -From 756556d127da291cad8a2c007a89124a692aef7f Mon Sep 17 00:00:00 2001 +From 4ba4b1e0bd1b69e124eb34c95ae9e7c087370efa Mon Sep 17 00:00:00 2001 From: Martin Bark Date: Fri, 6 May 2016 14:48:31 +0100 Subject: [PATCH] auto/lib/openssl/conf: use pkg-config @@ -8,25 +8,244 @@ dependencies. Signed-off-by: Martin Bark --- - auto/lib/openssl/conf | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) + auto/lib/openssl/conf | 187 +++++++++++++++++++++--------------------- + 1 file changed, 94 insertions(+), 93 deletions(-) diff --git a/auto/lib/openssl/conf b/auto/lib/openssl/conf -index 39d9602..995c6f3 100644 +index 4fb52df7..9f30490d 100644 --- a/auto/lib/openssl/conf +++ b/auto/lib/openssl/conf -@@ -58,8 +58,9 @@ else - ngx_feature_name="NGX_OPENSSL" - ngx_feature_run=no - ngx_feature_incs="#include " -- ngx_feature_path= -- ngx_feature_libs="-lssl -lcrypto $NGX_LIBDL" -+ ngx_feature_path="$(${PKG_CONFIG:=pkg-config} --cflags-only-I openssl| -+ sed -re 's/(^|\s)-I\s*(\S+)/\1\2/g')" -+ ngx_feature_libs="$(${PKG_CONFIG:=pkg-config} --libs openssl)" - ngx_feature_test="SSL_CTX_set_options(NULL, 0)" - . auto/feature +@@ -1,4 +1,3 @@ +- + # Copyright (C) Igor Sysoev + # Copyright (C) Nginx, Inc. +@@ -7,123 +6,125 @@ if [ $OPENSSL != NONE ]; then + + case "$CC" in + +- cl | bcc32) +- have=NGX_OPENSSL . auto/have +- have=NGX_SSL . auto/have +- +- CFLAGS="$CFLAGS -DNO_SYS_TYPES_H" +- +- CORE_INCS="$CORE_INCS $OPENSSL/openssl/include" +- CORE_DEPS="$CORE_DEPS $OPENSSL/openssl/include/openssl/ssl.h" +- +- if [ -f $OPENSSL/ms/do_ms.bat ]; then +- # before OpenSSL 1.1.0 +- CORE_LIBS="$CORE_LIBS $OPENSSL/openssl/lib/ssleay32.lib" +- CORE_LIBS="$CORE_LIBS $OPENSSL/openssl/lib/libeay32.lib" +- else +- # OpenSSL 1.1.0+ +- CORE_LIBS="$CORE_LIBS $OPENSSL/openssl/lib/libssl.lib" +- CORE_LIBS="$CORE_LIBS $OPENSSL/openssl/lib/libcrypto.lib" +- fi +- +- # libeay32.lib requires gdi32.lib +- CORE_LIBS="$CORE_LIBS gdi32.lib" +- # OpenSSL 1.0.0 requires crypt32.lib +- CORE_LIBS="$CORE_LIBS crypt32.lib" +- ;; +- +- *) +- have=NGX_OPENSSL . auto/have +- have=NGX_SSL . auto/have +- +- CORE_INCS="$CORE_INCS $OPENSSL/.openssl/include" +- CORE_DEPS="$CORE_DEPS $OPENSSL/.openssl/include/openssl/ssl.h" +- CORE_LIBS="$CORE_LIBS $OPENSSL/.openssl/lib/libssl.a" +- CORE_LIBS="$CORE_LIBS $OPENSSL/.openssl/lib/libcrypto.a" +- CORE_LIBS="$CORE_LIBS $NGX_LIBDL" +- CORE_LIBS="$CORE_LIBS $NGX_LIBPTHREAD" +- +- if [ "$NGX_PLATFORM" = win32 ]; then +- CORE_LIBS="$CORE_LIBS -lgdi32 -lcrypt32 -lws2_32" +- fi +- ;; ++ cl | bcc32) ++ have=NGX_OPENSSL . auto/have ++ have=NGX_SSL . auto/have ++ ++ CFLAGS="$CFLAGS -DNO_SYS_TYPES_H" ++ ++ CORE_INCS="$CORE_INCS $OPENSSL/openssl/include" ++ CORE_DEPS="$CORE_DEPS $OPENSSL/openssl/include/openssl/ssl.h" ++ ++ if [ -f $OPENSSL/ms/do_ms.bat ]; then ++ # before OpenSSL 1.1.0 ++ CORE_LIBS="$CORE_LIBS $OPENSSL/openssl/lib/ssleay32.lib" ++ CORE_LIBS="$CORE_LIBS $OPENSSL/openssl/lib/libeay32.lib" ++ else ++ # OpenSSL 1.1.0+ ++ CORE_LIBS="$CORE_LIBS $OPENSSL/openssl/lib/libssl.lib" ++ CORE_LIBS="$CORE_LIBS $OPENSSL/openssl/lib/libcrypto.lib" ++ fi ++ ++ # libeay32.lib requires gdi32.lib ++ CORE_LIBS="$CORE_LIBS gdi32.lib" ++ # OpenSSL 1.0.0 requires crypt32.lib ++ CORE_LIBS="$CORE_LIBS crypt32.lib" ++ ;; ++ ++ *) ++ have=NGX_OPENSSL . auto/have ++ have=NGX_SSL . auto/have ++ ++ CORE_INCS="$CORE_INCS $OPENSSL/.openssl/include" ++ CORE_DEPS="$CORE_DEPS $OPENSSL/.openssl/include/openssl/ssl.h" ++ CORE_LIBS="$CORE_LIBS $OPENSSL/.openssl/lib/libssl.a" ++ CORE_LIBS="$CORE_LIBS $OPENSSL/.openssl/lib/libcrypto.a" ++ CORE_LIBS="$CORE_LIBS $NGX_LIBDL" ++ CORE_LIBS="$CORE_LIBS $NGX_LIBPTHREAD" ++ ++ if [ "$NGX_PLATFORM" = win32 ]; then ++ CORE_LIBS="$CORE_LIBS -lgdi32 -lcrypt32 -lws2_32" ++ fi ++ ;; + esac + + else + + if [ "$NGX_PLATFORM" != win32 ]; then + +- OPENSSL=NO ++ OPENSSL=NO + +- ngx_feature="OpenSSL library" +- ngx_feature_name="NGX_OPENSSL" +- ngx_feature_run=no +- ngx_feature_incs="#include " +- ngx_feature_path= +- ngx_feature_libs="-lssl -lcrypto $NGX_LIBDL $NGX_LIBPTHREAD" +- ngx_feature_test="SSL_CTX_set_options(NULL, 0)" +- . auto/feature ++ ngx_feature="OpenSSL library" ++ ngx_feature_name="NGX_OPENSSL" ++ ngx_feature_run=no ++ ngx_feature_incs="#include " ++ ngx_feature_path= ++ ngx_feature_path="$(${PKG_CONFIG:=pkg-config} --cflags-only-I openssl| ++ sed -re 's/(^|\s)-I\s*(\S+)/\1\2/g')" ++ ngx_feature_libs="$(${PKG_CONFIG:=pkg-config} --libs openssl)" ++ ngx_feature_test="SSL_CTX_set_options(NULL, 0)" ++ . auto/feature + +- if [ $ngx_found = no ]; then ++ if [ $ngx_found = no ]; then + +- # FreeBSD port ++ # FreeBSD port + +- ngx_feature="OpenSSL library in /usr/local/" +- ngx_feature_path="/usr/local/include" ++ ngx_feature="OpenSSL library in /usr/local/" ++ ngx_feature_path="/usr/local/include" + +- if [ $NGX_RPATH = YES ]; then +- ngx_feature_libs="-R/usr/local/lib -L/usr/local/lib -lssl -lcrypto" +- else +- ngx_feature_libs="-L/usr/local/lib -lssl -lcrypto" +- fi ++ if [ $NGX_RPATH = YES ]; then ++ ngx_feature_libs="-R/usr/local/lib -L/usr/local/lib -lssl -lcrypto" ++ else ++ ngx_feature_libs="-L/usr/local/lib -lssl -lcrypto" ++ fi + +- ngx_feature_libs="$ngx_feature_libs $NGX_LIBDL $NGX_LIBPTHREAD" ++ ngx_feature_libs="$ngx_feature_libs $NGX_LIBDL $NGX_LIBPTHREAD" + +- . auto/feature +- fi ++ . auto/feature ++ fi + +- if [ $ngx_found = no ]; then ++ if [ $ngx_found = no ]; then + +- # NetBSD port ++ # NetBSD port + +- ngx_feature="OpenSSL library in /usr/pkg/" +- ngx_feature_path="/usr/pkg/include" ++ ngx_feature="OpenSSL library in /usr/pkg/" ++ ngx_feature_path="/usr/pkg/include" + +- if [ $NGX_RPATH = YES ]; then +- ngx_feature_libs="-R/usr/pkg/lib -L/usr/pkg/lib -lssl -lcrypto" +- else +- ngx_feature_libs="-L/usr/pkg/lib -lssl -lcrypto" +- fi ++ if [ $NGX_RPATH = YES ]; then ++ ngx_feature_libs="-R/usr/pkg/lib -L/usr/pkg/lib -lssl -lcrypto" ++ else ++ ngx_feature_libs="-L/usr/pkg/lib -lssl -lcrypto" ++ fi + +- ngx_feature_libs="$ngx_feature_libs $NGX_LIBDL $NGX_LIBPTHREAD" ++ ngx_feature_libs="$ngx_feature_libs $NGX_LIBDL $NGX_LIBPTHREAD" + +- . auto/feature +- fi ++ . auto/feature ++ fi + +- if [ $ngx_found = no ]; then ++ if [ $ngx_found = no ]; then + +- # MacPorts ++ # MacPorts + +- ngx_feature="OpenSSL library in /opt/local/" +- ngx_feature_path="/opt/local/include" ++ ngx_feature="OpenSSL library in /opt/local/" ++ ngx_feature_path="/opt/local/include" + +- if [ $NGX_RPATH = YES ]; then +- ngx_feature_libs="-R/opt/local/lib -L/opt/local/lib -lssl -lcrypto" +- else +- ngx_feature_libs="-L/opt/local/lib -lssl -lcrypto" +- fi ++ if [ $NGX_RPATH = YES ]; then ++ ngx_feature_libs="-R/opt/local/lib -L/opt/local/lib -lssl -lcrypto" ++ else ++ ngx_feature_libs="-L/opt/local/lib -lssl -lcrypto" ++ fi + +- ngx_feature_libs="$ngx_feature_libs $NGX_LIBDL $NGX_LIBPTHREAD" ++ ngx_feature_libs="$ngx_feature_libs $NGX_LIBDL $NGX_LIBPTHREAD" + +- . auto/feature +- fi ++ . auto/feature ++ fi + +- if [ $ngx_found = yes ]; then +- have=NGX_SSL . auto/have +- CORE_INCS="$CORE_INCS $ngx_feature_path" +- CORE_LIBS="$CORE_LIBS $ngx_feature_libs" +- OPENSSL=YES +- fi ++ if [ $ngx_found = yes ]; then ++ have=NGX_SSL . auto/have ++ CORE_INCS="$CORE_INCS $ngx_feature_path" ++ CORE_LIBS="$CORE_LIBS $ngx_feature_libs" ++ OPENSSL=YES ++ fi + fi + + if [ $OPENSSL != YES ]; then +@@ -136,7 +137,7 @@ into the system, or build the OpenSSL library statically from the source + with nginx by using --with-openssl= option. + + END +- exit 1 ++ exit 1 + fi + + fi -- -2.8.2 +2.17.1 diff --git a/bsp/buildroot/package/nginx/0007-auto-lib-libgd-conf-use-pkg-config.patch b/bsp/buildroot/package/nginx/0007-auto-lib-libgd-conf-use-pkg-config.patch index 34e7981c..cea68035 100644 --- a/bsp/buildroot/package/nginx/0007-auto-lib-libgd-conf-use-pkg-config.patch +++ b/bsp/buildroot/package/nginx/0007-auto-lib-libgd-conf-use-pkg-config.patch @@ -1,4 +1,4 @@ -From fd9885fe5fef5826034547ca6be7299863f99769 Mon Sep 17 00:00:00 2001 +From 0551f2e5eb4143be0aacc0185cdc4afc9ca80204 Mon Sep 17 00:00:00 2001 From: Martin Bark Date: Fri, 6 May 2016 14:48:49 +0100 Subject: [PATCH] auto/lib/libgd/conf: use pkg-config @@ -7,12 +7,14 @@ Change to using pkg-config to find the path to libgd and its dependencies. Signed-off-by: Martin Bark +[Peter: updated for 1.15.6] +Signed-off-by: Peter Korsgaard --- auto/lib/libgd/conf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/auto/lib/libgd/conf b/auto/lib/libgd/conf -index 6e4e91c..1c536a2 100644 +index 67863976..1a4379a5 100644 --- a/auto/lib/libgd/conf +++ b/auto/lib/libgd/conf @@ -7,8 +7,8 @@ @@ -23,9 +25,9 @@ index 6e4e91c..1c536a2 100644 - ngx_feature_libs="-lgd" + ngx_feature_path="$(${GDLIB_CONFIG:=gdlib-config} --includedir)" + ngx_feature_libs="$(${GDLIB_CONFIG:=gdlib-config} --libs)" - ngx_feature_test="gdImagePtr img = gdImageCreateFromGifPtr(1, NULL);" + ngx_feature_test="gdImagePtr img = gdImageCreateFromGifPtr(1, NULL); + (void) img" . auto/feature - -- -2.8.2 +2.11.0 diff --git a/bsp/buildroot/package/nginx/0009-auto-lib-conf-fix-PCRE-condition-WRT-the-http-and-ht.patch b/bsp/buildroot/package/nginx/0009-auto-lib-conf-fix-PCRE-condition-WRT-the-http-and-ht.patch deleted file mode 100644 index 08456511..00000000 --- a/bsp/buildroot/package/nginx/0009-auto-lib-conf-fix-PCRE-condition-WRT-the-http-and-ht.patch +++ /dev/null @@ -1,33 +0,0 @@ -From 9668f0d5ecd2382fd36b7ff6a3a29abd04f6533f Mon Sep 17 00:00:00 2001 -From: Samuel Martin -Date: Fri, 14 Jul 2017 11:50:08 +0200 -Subject: [PATCH] auto/lib/conf: fix PCRE condition WRT the http and - http_rewrite options - -http_rewrite module cannot be selected when http server is disabled, so -fix the PCRE check condition to avoid irrelevant check failure. - -Fixes: - http://autobuild.buildroot.net/results/bc7/bc7458b97a88785653845afd30fe9d5f3a69905b/build-end.log - -Signed-off-by: Samuel Martin ---- - auto/lib/conf | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/auto/lib/conf b/auto/lib/conf -index 0b8545a3..2c7af104 100644 ---- a/auto/lib/conf -+++ b/auto/lib/conf -@@ -7,7 +7,7 @@ if [ $USE_PCRE = YES -o $PCRE != NONE ]; then - . auto/lib/pcre/conf - - else -- if [ $USE_PCRE = DISABLED -a $HTTP_REWRITE = YES ]; then -+ if [ $USE_PCRE = DISABLED -a $HTTP = YES -a $HTTP_REWRITE = YES ]; then - - cat << END - --- -2.13.2 - diff --git a/bsp/buildroot/package/nginx/nginx.hash b/bsp/buildroot/package/nginx/nginx.hash index 9936ca1d..c3e6b6a7 100644 --- a/bsp/buildroot/package/nginx/nginx.hash +++ b/bsp/buildroot/package/nginx/nginx.hash @@ -1,4 +1,4 @@ # Locally calculated after checking pgp signature -sha256 305f379da1d5fb5aefa79e45c829852ca6983c7cd2a79328f8e084a324cf0416 nginx-1.12.2.tar.gz +sha256 a3d8c67c2035808c7c0d475fffe263db8c353b11521aa7ade468b780ed826cc6 nginx-1.15.6.tar.gz # License files, locally calculated -sha256 75820469c890db641e54078df018e497fde0542211aa704e15320316a2175780 LICENSE +sha256 e18f05bcaad47528f8b21861d4a0fb9815ca1bbb4be946c51a51d36623758bcc LICENSE diff --git a/bsp/buildroot/package/nginx/nginx.mk b/bsp/buildroot/package/nginx/nginx.mk index e5652af6..52531744 100644 --- a/bsp/buildroot/package/nginx/nginx.mk +++ b/bsp/buildroot/package/nginx/nginx.mk @@ -4,7 +4,7 @@ # ################################################################################ -NGINX_VERSION = 1.12.2 +NGINX_VERSION = 1.15.6 NGINX_SITE = http://nginx.org/download NGINX_LICENSE = BSD-2-Clause NGINX_LICENSE_FILES = LICENSE diff --git a/bsp/buildroot/package/nmap/Config.in b/bsp/buildroot/package/nmap/Config.in index 79f587af..1f2f996a 100644 --- a/bsp/buildroot/package/nmap/Config.in +++ b/bsp/buildroot/package/nmap/Config.in @@ -3,6 +3,7 @@ config BR2_PACKAGE_NMAP depends on BR2_INSTALL_LIBSTDCPP depends on BR2_USE_MMU # fork() depends on BR2_TOOLCHAIN_HAS_THREADS + select BR2_PACKAGE_LIBLINEAR select BR2_PACKAGE_LIBPCAP select BR2_PACKAGE_PCRE help diff --git a/bsp/buildroot/package/nmap/nmap.mk b/bsp/buildroot/package/nmap/nmap.mk index ceb08ec0..3110dfeb 100644 --- a/bsp/buildroot/package/nmap/nmap.mk +++ b/bsp/buildroot/package/nmap/nmap.mk @@ -7,11 +7,11 @@ NMAP_VERSION = 7.60 NMAP_SITE = https://nmap.org/dist NMAP_SOURCE = nmap-$(NMAP_VERSION).tar.bz2 -NMAP_DEPENDENCIES = libpcap pcre host-autoconf +NMAP_DEPENDENCIES = libpcap liblinear pcre host-autoconf NMAP_CONF_OPTS = --without-liblua --without-zenmap \ - --with-libdnet=included --with-liblinear=included \ + --with-libdnet=included \ --with-libpcre="$(STAGING_DIR)/usr" --without-ncat -NMAP_LICENSE = GPL-2.0 +NMAP_LICENSE = nmap license NMAP_LICENSE_FILES = COPYING # nmap doesn't autoreconf properly, so we just re-generate the diff --git a/bsp/buildroot/package/nodejs/nodejs.mk b/bsp/buildroot/package/nodejs/nodejs.mk index e2c94ba8..3c5e40a4 100644 --- a/bsp/buildroot/package/nodejs/nodejs.mk +++ b/bsp/buildroot/package/nodejs/nodejs.mk @@ -154,6 +154,7 @@ NPM = $(TARGET_CONFIGURE_OPTS) \ npm_config_build_from_source=true \ npm_config_nodedir=$(BUILD_DIR)/nodejs-$(NODEJS_VERSION) \ npm_config_prefix=$(TARGET_DIR)/usr \ + npm_config_cache=$(BUILD_DIR)/.npm-cache \ $(HOST_DIR)/bin/npm # diff --git a/bsp/buildroot/package/ntp/0003-fix-nommu.patch b/bsp/buildroot/package/ntp/0003-fix-nommu.patch new file mode 100644 index 00000000..0959fa0b --- /dev/null +++ b/bsp/buildroot/package/ntp/0003-fix-nommu.patch @@ -0,0 +1,29 @@ +Fix no-MMU build + +The detach_from_terminal() is unused for no-MMU, but it depends on symbols +that are not defined for no-MMU. Don't define detach_from_terminal() when +HAVE_WORKING_FORK is not defined. + +Signed-off-by: Baruch Siach +--- +Upstream status: http://bugs.ntp.org/show_bug.cgi?id=3538 + +diff -Nuar ntp-4.2.8p12.orig/ntpd/ntpd.c ntp-4.2.8p12/ntpd/ntpd.c +--- ntp-4.2.8p12.orig/ntpd/ntpd.c 2018-08-14 14:51:30.000000000 +0300 ++++ ntp-4.2.8p12/ntpd/ntpd.c 2018-10-13 21:25:25.858261249 +0300 +@@ -534,6 +534,7 @@ + * Detach from terminal (much like daemon()) + * Nothe that this function calls exit() + */ ++# ifdef HAVE_WORKING_FORK + static void + detach_from_terminal( + int pipe_fds[2], +@@ -617,6 +618,7 @@ + + return; + } ++# endif /* HAVE_WORKING_FORK */ + + #ifdef HAVE_DROPROOT + /* diff --git a/bsp/buildroot/package/ntp/0004-fix-work-fork-without-droproot.patch b/bsp/buildroot/package/ntp/0004-fix-work-fork-without-droproot.patch new file mode 100644 index 00000000..cb6fec01 --- /dev/null +++ b/bsp/buildroot/package/ntp/0004-fix-work-fork-without-droproot.patch @@ -0,0 +1,26 @@ +Fix work_fork build when droproot is disabled + +The set_user_group_ids() depends on HAVE_DROPROOT. When HAVE_DROPROOT is not +enabled, work_fork.c code causes a link failure: + +../libntp/libntp.a(work_fork.o): In function `send_blocking_req_internal': +work_fork.c:(.text+0x498): undefined reference to `set_user_group_ids' + +Make the set_user_group_ids() call depend on HAVE_DROPROOT. + +Signed-off-by: Baruch Siach +--- +Upstream status: http://bugs.ntp.org/show_bug.cgi?id=3539 + +--- ntp-4.2.8p12.orig/libntp/work_fork.c 2018-08-14 14:51:06.000000000 +0300 ++++ ntp-4.2.8p12/libntp/work_fork.c 2018-10-15 21:10:54.580917962 +0300 +@@ -594,7 +594,9 @@ + init_logging("ntp_intres", 0, FALSE); + setup_logfile(NULL); + ++#if defined(HAVE_DROPROOT) + (void) set_user_group_ids(); ++#endif + + /* + * And now back to the portable code diff --git a/bsp/buildroot/package/ntp/ntp.hash b/bsp/buildroot/package/ntp/ntp.hash index ea86c158..2fd8a832 100644 --- a/bsp/buildroot/package/ntp/ntp.hash +++ b/bsp/buildroot/package/ntp/ntp.hash @@ -1,5 +1,5 @@ -# From https://www.eecis.udel.edu/~ntp/ntp_spool/ntp4/ntp-4.2/ntp-4.2.8p11.tar.gz.md5 -md5 00950ca2855579541896513e78295361 ntp-4.2.8p11.tar.gz +# From https://www.eecis.udel.edu/~ntp/ntp_spool/ntp4/ntp-4.2/ntp-4.2.8p12.tar.gz.md5 +md5 1522d66574bae14abb2622746dad2bdc ntp-4.2.8p12.tar.gz # Calculated based on the hash above -sha256 f14a39f753688252d683ff907035ffff106ba8d3db21309b742e09b5c3cd278e ntp-4.2.8p11.tar.gz +sha256 709b222b5013d77d26bfff532b5ea470a8039497ef29d09363931c036cb30454 ntp-4.2.8p12.tar.gz sha256 62c87b269365b38b55359b16dfde7ec28c683c722ef489db90afd0f2e478e4a1 COPYRIGHT diff --git a/bsp/buildroot/package/ntp/ntp.mk b/bsp/buildroot/package/ntp/ntp.mk index b5e2c1e0..edd3d521 100644 --- a/bsp/buildroot/package/ntp/ntp.mk +++ b/bsp/buildroot/package/ntp/ntp.mk @@ -5,7 +5,7 @@ ################################################################################ NTP_VERSION_MAJOR = 4.2 -NTP_VERSION = $(NTP_VERSION_MAJOR).8p11 +NTP_VERSION = $(NTP_VERSION_MAJOR).8p12 NTP_SITE = https://www.eecis.udel.edu/~ntp/ntp_spool/ntp4/ntp-$(NTP_VERSION_MAJOR) NTP_DEPENDENCIES = host-pkgconf libevent $(if $(BR2_PACKAGE_BUSYBOX),busybox) NTP_LICENSE = NTP diff --git a/bsp/buildroot/package/open-plc-utils/open-plc-utils.mk b/bsp/buildroot/package/open-plc-utils/open-plc-utils.mk index d45bb9d4..e1e66bf7 100644 --- a/bsp/buildroot/package/open-plc-utils/open-plc-utils.mk +++ b/bsp/buildroot/package/open-plc-utils/open-plc-utils.mk @@ -15,8 +15,14 @@ OPEN_PLC_UTILS_LICENSE_FILES = LICENSE # Yes, we're passing __UCLIBC__ in EXTRA_CFLAGS, as it fixes a build # issue for non-uClibc toolchains. It is the very crappy solution # suggested at https://github.com/qca/open-plc-utils/issues/36. +OPEN_PLC_UTILS_MAKE_OPTS = \ + EXTRA_CFLAGS="$(TARGET_CFLAGS) -D__UCLIBC__" \ + EXTRA_CXXFLAGS="$(TARGET_CXXFLAGS)" \ + EXTRA_LDFLAGS="$(TARGET_LDFLAGS)" + define OPEN_PLC_UTILS_BUILD_CMDS - $(TARGET_MAKE_ENV) $(MAKE) CROSS=$(TARGET_CROSS) EXTRA_CFLAGS="-D__UCLIBC__" -C $(@D) + $(TARGET_MAKE_ENV) $(MAKE) CROSS=$(TARGET_CROSS) \ + $(OPEN_PLC_UTILS_MAKE_OPTS) -C $(@D) endef define OPEN_PLC_UTILS_INSTALL_TARGET_CMDS diff --git a/bsp/buildroot/package/openocd/openocd.mk b/bsp/buildroot/package/openocd/openocd.mk index 548d8b81..ca13d993 100644 --- a/bsp/buildroot/package/openocd/openocd.mk +++ b/bsp/buildroot/package/openocd/openocd.mk @@ -31,6 +31,7 @@ OPENOCD_CONF_OPTS = \ # the dependencies they need. OPENOCD_DEPENDENCIES = \ + host-pkgconf \ $(if $(BR2_PACKAGE_LIBFTDI1),libftdi1) \ $(if $(BR2_PACKAGE_LIBUSB),libusb) \ $(if $(BR2_PACKAGE_LIBUSB_COMPAT),libusb-compat) \ diff --git a/bsp/buildroot/package/openswan/openswan.hash b/bsp/buildroot/package/openswan/openswan.hash index 805ab948..de0fa050 100644 --- a/bsp/buildroot/package/openswan/openswan.hash +++ b/bsp/buildroot/package/openswan/openswan.hash @@ -1,2 +1,4 @@ # Locally calculated -sha256 9a3eb041084c3ab125dd645c40e8f5563efe73e18a3881cf2ce3582001daafc5 openswan-2.6.50.tar.gz +sha256 857c0d0b9a7e447d2857bf4d0f7118d7ed1196499e0b640e53e5c6bd0c0185d9 openswan-2.6.51.1.tar.gz +sha256 1c36ae1e7b0f6cce4b4ffe969b71f83635734804acdd38544443564b00f8783a COPYING +sha256 d7d012ef3be47faffba4d97a83d4986c9f4a63ac997ebf5961d33852e5f1801a LICENSE diff --git a/bsp/buildroot/package/openswan/openswan.mk b/bsp/buildroot/package/openswan/openswan.mk index 928eb9bb..d7f1c464 100644 --- a/bsp/buildroot/package/openswan/openswan.mk +++ b/bsp/buildroot/package/openswan/openswan.mk @@ -4,13 +4,13 @@ # ################################################################################ -OPENSWAN_VERSION = 2.6.50 +OPENSWAN_VERSION = 2.6.51.1 OPENSWAN_SITE = https://download.openswan.org/openswan OPENSWAN_LICENSE = GPL-2.0+, BSD-3-Clause OPENSWAN_LICENSE_FILES = COPYING LICENSE OPENSWAN_DEPENDENCIES = host-bison host-flex gmp iproute2 -OPENSWAN_MAKE_OPTS = ARCH=$(BR2_ARCH) CC="$(TARGET_CC)" \ +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 diff --git a/bsp/buildroot/package/p11-kit/p11-kit.mk b/bsp/buildroot/package/p11-kit/p11-kit.mk index d4cf9bc0..10b5cc03 100644 --- a/bsp/buildroot/package/p11-kit/p11-kit.mk +++ b/bsp/buildroot/package/p11-kit/p11-kit.mk @@ -14,4 +14,10 @@ P11_KIT_CONF_ENV = ac_cv_have_decl_program_invocation_short_name=yes \ P11_KIT_LICENSE = BSD-3-Clause P11_KIT_LICENSE_FILES = COPYING +ifeq ($(BR2_PACKAGE_CA_CERTIFICATES),y) +P11_KIT_CONF_OPTS += --with-trust-paths=/etc/ssl/certs/ca-certificates.crt +else +P11_KIT_CONF_OPTS += --without-trust-paths +endif + $(eval $(autotools-package)) diff --git a/bsp/buildroot/package/pkg-download.mk b/bsp/buildroot/package/pkg-download.mk index 6f15deba..f398d168 100644 --- a/bsp/buildroot/package/pkg-download.mk +++ b/bsp/buildroot/package/pkg-download.mk @@ -31,8 +31,8 @@ else BR2_DL_DIR = $(DL_DIR) endif -# ensure it exists and a absolute path -DL_DIR := $(shell mkdir -p $(DL_DIR) && cd $(DL_DIR) >/dev/null && pwd) +# ensure it exists and a absolute path, derefrecing symlinks +DL_DIR := $(shell mkdir -p $(DL_DIR) && cd $(DL_DIR) >/dev/null && pwd -P) # # URI scheme helper functions diff --git a/bsp/buildroot/package/pkg-generic.mk b/bsp/buildroot/package/pkg-generic.mk index a689dde4..d25f0f9a 100644 --- a/bsp/buildroot/package/pkg-generic.mk +++ b/bsp/buildroot/package/pkg-generic.mk @@ -736,6 +736,7 @@ $(1)-show-rdepends: @echo $$($(2)_RDEPENDENCIES) $(1)-show-build-order: $$(patsubst %,%-show-build-order,$$($(2)_FINAL_ALL_DEPENDENCIES)) + @: $$(info $(1)) $(1)-graph-depends: graph-depends-requirements diff --git a/bsp/buildroot/package/poco/poco.mk b/bsp/buildroot/package/poco/poco.mk index 3dddb435..fd3db6f5 100644 --- a/bsp/buildroot/package/poco/poco.mk +++ b/bsp/buildroot/package/poco/poco.mk @@ -37,6 +37,11 @@ ifeq ($(BR2_sh4a)$(BR2_nios2),y) POCO_CONF_OPTS += --no-fpenvironment endif +# disable fpenvironment for soft floating point configuration +ifeq ($(BR2_SOFT_FLOAT),y) +POCO_CONF_OPTS += --no-fpenvironment +endif + ifeq ($(BR2_STATIC_LIBS),y) POCO_MAKE_TARGET = static_release else ifeq ($(BR2_SHARED_LIBS),y) diff --git a/bsp/buildroot/package/postgresql/postgresql.hash b/bsp/buildroot/package/postgresql/postgresql.hash index a9cc93c7..05f94b4c 100644 --- a/bsp/buildroot/package/postgresql/postgresql.hash +++ b/bsp/buildroot/package/postgresql/postgresql.hash @@ -1,5 +1,5 @@ -# From https://ftp.postgresql.org/pub/source/v10.5/postgresql-10.5.tar.bz2.sha256 -sha256 6c8e616c91a45142b85c0aeb1f29ebba4a361309e86469e0fb4617b6a73c4011 postgresql-10.5.tar.bz2 +# From https://ftp.postgresql.org/pub/source/v10.6/postgresql-10.6.tar.bz2.sha256 +sha256 68a8276f08bda8fbefe562faaf8831cb20664a7a1d3ffdbbcc5b83e08637624b postgresql-10.6.tar.bz2 # License file, Locally calculated sha256 24cfc70cf16b3a23242c49ffce39510683bdd48cbedb8a46fe03976ee5f5c21e COPYRIGHT diff --git a/bsp/buildroot/package/postgresql/postgresql.mk b/bsp/buildroot/package/postgresql/postgresql.mk index f6dad978..66af8fe5 100644 --- a/bsp/buildroot/package/postgresql/postgresql.mk +++ b/bsp/buildroot/package/postgresql/postgresql.mk @@ -4,7 +4,7 @@ # ################################################################################ -POSTGRESQL_VERSION = 10.5 +POSTGRESQL_VERSION = 10.6 POSTGRESQL_SOURCE = postgresql-$(POSTGRESQL_VERSION).tar.bz2 POSTGRESQL_SITE = http://ftp.postgresql.org/pub/source/v$(POSTGRESQL_VERSION) POSTGRESQL_LICENSE = PostgreSQL diff --git a/bsp/buildroot/package/prosody/prosody.hash b/bsp/buildroot/package/prosody/prosody.hash index 38942ea7..8debfe19 100644 --- a/bsp/buildroot/package/prosody/prosody.hash +++ b/bsp/buildroot/package/prosody/prosody.hash @@ -1,5 +1,2 @@ -# Hashes from: https://prosody.im/downloads/source/{MD5,SHA1,SHA256,SHA512}SUMS -md5 d743adea6cfbaacc3a24cc0c3928bb1b prosody-0.9.12.tar.gz -sha1 1ee224263a5b3d67960e12edbbe6b2f16b95d147 prosody-0.9.12.tar.gz -sha256 1a59a322b71928a21985522aa00d0eab3552208d7bf9ecb318542a1b2fee3e8d prosody-0.9.12.tar.gz -sha512 e87b5f3b3e327722cec9d8d0470684e2ec2788a1c5ae623c4f505a00572ef21f65afe84cd5b7de47d6a65fe8872506fe34e5e8886e20979ff84710669857ca76 prosody-0.9.12.tar.gz +# Locally calculated +sha256 27d1388acd79eaa453f2b194bd23c25121fe0a704d0dd940457caf1874ea1123 prosody-0.9.14.tar.gz diff --git a/bsp/buildroot/package/prosody/prosody.mk b/bsp/buildroot/package/prosody/prosody.mk index d1965350..ab50cc88 100644 --- a/bsp/buildroot/package/prosody/prosody.mk +++ b/bsp/buildroot/package/prosody/prosody.mk @@ -4,7 +4,7 @@ # ################################################################################ -PROSODY_VERSION = 0.9.12 +PROSODY_VERSION = 0.9.14 PROSODY_SITE = https://prosody.im/downloads/source PROSODY_LICENSE = MIT PROSODY_LICENSE_FILES = COPYING diff --git a/bsp/buildroot/package/psmisc/psmisc.mk b/bsp/buildroot/package/psmisc/psmisc.mk index 3d9a8046..6c343a4f 100644 --- a/bsp/buildroot/package/psmisc/psmisc.mk +++ b/bsp/buildroot/package/psmisc/psmisc.mk @@ -7,7 +7,7 @@ PSMISC_VERSION = 23.1 PSMISC_SITE = http://downloads.sourceforge.net/project/psmisc/psmisc PSMISC_SOURCE = psmisc-$(PSMISC_VERSION).tar.xz -PSMISC_LICENSE = GPL-2.0 +PSMISC_LICENSE = GPL-2.0+ PSMISC_LICENSE_FILES = COPYING PSMISC_DEPENDENCIES = ncurses $(TARGET_NLS_DEPENDENCIES) # Patching Makefile.am diff --git a/bsp/buildroot/package/ptpd2/0002-ntp_isc_md5-rename-EVP_MD_CTX-into-PTPD_EVP_MD_CTX.patch b/bsp/buildroot/package/ptpd2/0002-ntp_isc_md5-rename-EVP_MD_CTX-into-PTPD_EVP_MD_CTX.patch new file mode 100644 index 00000000..e655ff33 --- /dev/null +++ b/bsp/buildroot/package/ptpd2/0002-ntp_isc_md5-rename-EVP_MD_CTX-into-PTPD_EVP_MD_CTX.patch @@ -0,0 +1,46 @@ +From af1d16d90ff273413a57cd02689f4fb005403609 Mon Sep 17 00:00:00 2001 +From: Giulio Benetti +Date: Fri, 31 Aug 2018 18:46:56 +0200 +Subject: [PATCH] ntp_isc_md5: rename EVP_MD_CTX into PTPD_EVP_MD_CTX + +EVP_MD_CTX can conflict with openssl that defines a completely different +typedef with same name. + +Since this typedef is used only twice in the entire ptpd, +substitute EVP_MD_CTX with PTPD_EVP_MD_CTX. + +Signed-off-by: Giulio Benetti +--- + src/dep/ntpengine/ntp_isc_md5.c | 2 +- + src/dep/ntpengine/ntp_isc_md5.h | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +diff --git a/src/dep/ntpengine/ntp_isc_md5.c b/src/dep/ntpengine/ntp_isc_md5.c +index 850d004..3216de8 100644 +--- a/src/dep/ntpengine/ntp_isc_md5.c ++++ b/src/dep/ntpengine/ntp_isc_md5.c +@@ -262,7 +262,7 @@ MD5authencrypt( + { + u_char digest[64]; + u_int len; +- EVP_MD_CTX ctx; ++ PTPD_EVP_MD_CTX ctx; + pkt[length / 4] = htonl(keyid); + EVP_DigestInit(&ctx); + EVP_DigestUpdate(&ctx, (u_char *)key, (u_int)strlen(key)); +diff --git a/src/dep/ntpengine/ntp_isc_md5.h b/src/dep/ntpengine/ntp_isc_md5.h +index fa6e2ee..236c0e4 100644 +--- a/src/dep/ntpengine/ntp_isc_md5.h ++++ b/src/dep/ntpengine/ntp_isc_md5.h +@@ -80,7 +80,7 @@ isc_md5_final(isc_md5_t *ctx, unsigned char *digest); + # define MD5Init(c) isc_md5_init(c) + # define MD5Update(c, p, s) isc_md5_update(c, p, s) + # define MD5Final(d, c) isc_md5_final((c), (d)) /* swapped */ +- typedef MD5_CTX EVP_MD_CTX; ++ typedef MD5_CTX PTPD_EVP_MD_CTX; + # define EVP_DigestInit(c) MD5Init(c) + # define EVP_DigestUpdate(c, p, s) MD5Update(c, p, s) + # define EVP_DigestFinal(c, d, pdl) \ +-- +2.14.4 + diff --git a/bsp/buildroot/package/ptpd2/0003-Solve-issue-25-Removing-type-U64-from-net-snmp-relat.patch b/bsp/buildroot/package/ptpd2/0003-Solve-issue-25-Removing-type-U64-from-net-snmp-relat.patch new file mode 100644 index 00000000..f952755d --- /dev/null +++ b/bsp/buildroot/package/ptpd2/0003-Solve-issue-25-Removing-type-U64-from-net-snmp-relat.patch @@ -0,0 +1,28 @@ +From 84157b11e8f27318f7291823c657f6313c3b60af Mon Sep 17 00:00:00 2001 +From: Jan Breuer +Date: Tue, 12 Jul 2016 18:07:08 +0200 +Subject: [PATCH] Solve issue #25 - Removing type U64 from net-snmp related + code + +[Thomas: Backport to 2.3.1.] +Signed-off-by: Thomas Petazzoni +--- + src/dep/snmp.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/dep/snmp.c b/src/dep/snmp.c +index 5c08aaa..3086c86 100644 +--- a/src/dep/snmp.c ++++ b/src/dep/snmp.c +@@ -221,7 +221,7 @@ snmpHeaderIndexBest(struct snmpHeaderIndex *idx) + + #define SNMP_LOCAL_VARIABLES \ + static unsigned long long_ret; \ +- static U64 counter64_ret; \ ++ static struct counter64 counter64_ret; \ + static uint32_t ipaddr; \ + Integer64 bigint; \ + struct snmpHeaderIndex idx; \ +-- +2.14.4 + diff --git a/bsp/buildroot/package/python-enum34/python-enum34.mk b/bsp/buildroot/package/python-enum34/python-enum34.mk index c612cb65..09d1143a 100644 --- a/bsp/buildroot/package/python-enum34/python-enum34.mk +++ b/bsp/buildroot/package/python-enum34/python-enum34.mk @@ -12,3 +12,4 @@ PYTHON_ENUM34_LICENSE = BSD-3-Clause PYTHON_ENUM34_LICENSE_FILES = enum/LICENSE $(eval $(python-package)) +$(eval $(host-python-package)) diff --git a/bsp/buildroot/package/qemu/0001-user-exec-fix-usage-of-mcontext-structure-on-ARM-uCl.patch b/bsp/buildroot/package/qemu/0001-user-exec-fix-usage-of-mcontext-structure-on-ARM-uCl.patch index 6d6d024d..a0c4a620 100644 --- a/bsp/buildroot/package/qemu/0001-user-exec-fix-usage-of-mcontext-structure-on-ARM-uCl.patch +++ b/bsp/buildroot/package/qemu/0001-user-exec-fix-usage-of-mcontext-structure-on-ARM-uCl.patch @@ -17,11 +17,11 @@ Signed-off-by: Thomas Petazzoni user-exec.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -diff --git a/user-exec.c b/user-exec.c +diff --git a/accel/tcg/user-exec.c b/accel/tcg/user-exec.c index 6db0758..2b3d116 100644 ---- a/user-exec.c -+++ b/user-exec.c -@@ -409,7 +409,7 @@ int cpu_signal_handler(int host_signum, void *pinfo, +--- a/accel/tcg/user-exec.c ++++ b/accel/tcg/user-exec.c +@@ -463,7 +463,7 @@ int cpu_signal_handler(int host_signum, void *pinfo, #if defined(__NetBSD__) pc = uc->uc_mcontext.__gregs[_REG_R15]; diff --git a/bsp/buildroot/package/qemu/0002-memfd-fix-configure-test.patch b/bsp/buildroot/package/qemu/0002-memfd-fix-configure-test.patch deleted file mode 100644 index 3e06c0e9..00000000 --- a/bsp/buildroot/package/qemu/0002-memfd-fix-configure-test.patch +++ /dev/null @@ -1,58 +0,0 @@ -From 75e5b70e6b5dcc4f2219992d7cffa462aa406af0 Mon Sep 17 00:00:00 2001 -From: Paolo Bonzini -Date: Tue, 28 Nov 2017 11:51:27 +0100 -Subject: [PATCH] memfd: fix configure test -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -Recent glibc added memfd_create in sys/mman.h. This conflicts with -the definition in util/memfd.c: - - /builddir/build/BUILD/qemu-2.11.0-rc1/util/memfd.c:40:12: error: static declaration of memfd_create follows non-static declaration - -Fix the configure test, and remove the sys/memfd.h inclusion since the -file actually does not exist---it is a typo in the memfd_create(2) man -page. - -Cc: Marc-André Lureau -Signed-off-by: Paolo Bonzini -Signed-off-by: Baruch Siach ---- -Upstream status: commit 75e5b70e6b5 - - configure | 2 +- - util/memfd.c | 4 +--- - 2 files changed, 2 insertions(+), 4 deletions(-) - -diff --git a/configure b/configure -index 9c8aa5a98bd4..99ccc1725ace 100755 ---- a/configure -+++ b/configure -@@ -3923,7 +3923,7 @@ fi - # check if memfd is supported - memfd=no - cat > $TMPC << EOF --#include -+#include - - int main(void) - { -diff --git a/util/memfd.c b/util/memfd.c -index 4571d1aba866..412e94a405fc 100644 ---- a/util/memfd.c -+++ b/util/memfd.c -@@ -31,9 +31,7 @@ - - #include "qemu/memfd.h" - --#ifdef CONFIG_MEMFD --#include --#elif defined CONFIG_LINUX -+#if defined CONFIG_LINUX && !defined CONFIG_MEMFD - #include - #include - --- -2.16.2 - diff --git a/bsp/buildroot/package/qemu/Config.in b/bsp/buildroot/package/qemu/Config.in index 13b615bf..cf25c351 100644 --- a/bsp/buildroot/package/qemu/Config.in +++ b/bsp/buildroot/package/qemu/Config.in @@ -97,7 +97,9 @@ comment "Frontends" config BR2_PACKAGE_QEMU_SDL bool "Enable SDL frontend" + depends on BR2_PACKAGE_XORG7 select BR2_PACKAGE_SDL + select BR2_PACKAGE_SDL_X11 help Say 'y' to enable the SDL frontend, that is, a graphical window presenting the VM's display. diff --git a/bsp/buildroot/package/qemu/Config.in.host b/bsp/buildroot/package/qemu/Config.in.host index f14bcec6..957c7d2a 100644 --- a/bsp/buildroot/package/qemu/Config.in.host +++ b/bsp/buildroot/package/qemu/Config.in.host @@ -1,13 +1,39 @@ +config BR2_PACKAGE_HOST_QEMU_ARCH_SUPPORTS + bool + default y if BR2_arm + default y if BR2_armeb + default y if BR2_aarch64 + default y if BR2_i386 + default y if BR2_m68k + default y if BR2_microblazeel + default y if BR2_microblazebe + default y if BR2_mips + default y if BR2_mipsel + default y if BR2_powerpc + default y if BR2_powerpc64 + default y if BR2_powerpc64le + default y if BR2_sh + default y if BR2_sparc + default y if BR2_x86_64 + depends on !BR2_powerpc_620 && !BR2_powerpc_630 && !BR2_powerpc_970 + +config BR2_PACKAGE_HOST_QEMU_SYSTEM_ARCH_SUPPORTS + bool + default y if BR2_PACKAGE_HOST_QEMU_ARCH_SUPPORTS + default y if BR2_mips64 + default y if BR2_mips64el + +config BR2_PACKAGE_HOST_QEMU_USER_ARCH_SUPPORTS + bool + default y if BR2_PACKAGE_HOST_QEMU_ARCH_SUPPORTS + config BR2_PACKAGE_HOST_QEMU bool "host qemu" - depends on BR2_arm || BR2_armeb || BR2_aarch64 || \ - BR2_i386 || BR2_m68k || BR2_microblazeel || \ - BR2_microblazebe || BR2_mips || BR2_mipsel || \ - BR2_mips64 || BR2_mips64el || BR2_powerpc || \ - BR2_powerpc64 || BR2_powerpc64le || BR2_sh || \ - BR2_sparc || BR2_x86_64 + depends on BR2_PACKAGE_HOST_QEMU_SYSTEM_ARCH_SUPPORTS || BR2_PACKAGE_HOST_QEMU_USER_ARCH_SUPPORTS select BR2_PACKAGE_HOST_QEMU_LINUX_USER_MODE \ - if !BR2_PACKAGE_HOST_QEMU_SYSTEM_MODE + if !BR2_PACKAGE_HOST_QEMU_SYSTEM_MODE && BR2_PACKAGE_HOST_QEMU_USER_ARCH_SUPPORTS + select BR2_PACKAGE_HOST_QEMU_SYSTEM_MODE \ + if !BR2_PACKAGE_HOST_QEMU_USER_ARCH_SUPPORTS help QEMU is a generic and open source machine emulator and virtualizer. @@ -22,12 +48,14 @@ comment "Emulators selection" config BR2_PACKAGE_HOST_QEMU_SYSTEM_MODE bool "Enable system emulation" + depends on BR2_PACKAGE_HOST_QEMU_SYSTEM_ARCH_SUPPORTS help Enables the build of the system emulator, which allows to boot an entire system in Qemu. config BR2_PACKAGE_HOST_QEMU_LINUX_USER_MODE bool "Enable Linux user-land emulation" + depends on BR2_PACKAGE_HOST_QEMU_USER_ARCH_SUPPORTS help Enables the build of the user-land emulator, which allows to run user-space applications. diff --git a/bsp/buildroot/package/qemu/qemu.hash b/bsp/buildroot/package/qemu/qemu.hash index 1173c1bf..2b27008b 100644 --- a/bsp/buildroot/package/qemu/qemu.hash +++ b/bsp/buildroot/package/qemu/qemu.hash @@ -1,4 +1,4 @@ # Locally computed, tarball verified with GPG signature -sha256 fcfdaa1ecdaac8aead616fe811bfb8fe4a8f2cd59796aa446c5175b5af0e829f qemu-2.10.2.tar.xz +sha256 33583800e0006cd00b78226b85be5a27c8e3b156bed2e60e83ecbeb7b9b8364f qemu-2.12.1.tar.xz sha256 6f04ae8364d0079a192b14635f4b1da294ce18724c034c39a6a41d1b09df6100 COPYING sha256 48ffe9fc7f1d5462dbd19340bc4dd1d8a9e37c61ed535813e614cbe4a5f0d4df COPYING.LIB diff --git a/bsp/buildroot/package/qemu/qemu.mk b/bsp/buildroot/package/qemu/qemu.mk index c3a7e773..758c2239 100644 --- a/bsp/buildroot/package/qemu/qemu.mk +++ b/bsp/buildroot/package/qemu/qemu.mk @@ -4,7 +4,7 @@ # ################################################################################ -QEMU_VERSION = 2.10.2 +QEMU_VERSION = 2.12.1 QEMU_SOURCE = qemu-$(QEMU_VERSION).tar.xz QEMU_SITE = http://download.qemu.org QEMU_LICENSE = GPL-2.0, LGPL-2.1, MIT, BSD-3-Clause, BSD-2-Clause, Others/BSD-1c @@ -13,6 +13,137 @@ QEMU_LICENSE_FILES = COPYING COPYING.LIB # the non-(L)GPL license texts are specified in the affected # individual source files. +#------------------------------------------------------------- +# Target-qemu + +QEMU_DEPENDENCIES = host-pkgconf host-python libglib2 zlib pixman + +# Need the LIBS variable because librt and libm are +# not automatically pulled. :-( +QEMU_LIBS = -lrt -lm + +QEMU_OPTS = + +QEMU_VARS = \ + LIBTOOL=$(HOST_DIR)/bin/libtool \ + PYTHON=$(HOST_DIR)/bin/python2 \ + PYTHONPATH=$(TARGET_DIR)/usr/lib/python$(PYTHON_VERSION_MAJOR)/site-packages + +# If we want to specify only a subset of targets, we must still enable all +# of them, so that QEMU properly builds its list of default targets, from +# which it then checks if the specified sub-set is valid. That's what we +# do in the first part of the if-clause. +# Otherwise, if we do not want to pass a sub-set of targets, we then need +# to either enable or disable -user and/or -system emulation appropriately. +# That's what we do in the else-clause. +ifneq ($(call qstrip,$(BR2_PACKAGE_QEMU_CUSTOM_TARGETS)),) +QEMU_OPTS += --enable-system --enable-linux-user +QEMU_OPTS += --target-list="$(call qstrip,$(BR2_PACKAGE_QEMU_CUSTOM_TARGETS))" +else + +ifeq ($(BR2_PACKAGE_QEMU_SYSTEM),y) +QEMU_OPTS += --enable-system +else +QEMU_OPTS += --disable-system +endif + +ifeq ($(BR2_PACKAGE_QEMU_LINUX_USER),y) +QEMU_OPTS += --enable-linux-user +else +QEMU_OPTS += --disable-linux-user +endif + +endif + +ifeq ($(BR2_PACKAGE_QEMU_SDL),y) +QEMU_OPTS += --enable-sdl +QEMU_DEPENDENCIES += sdl +QEMU_VARS += SDL_CONFIG=$(BR2_STAGING_DIR)/usr/bin/sdl-config +else +QEMU_OPTS += --disable-sdl +endif + +ifeq ($(BR2_PACKAGE_QEMU_FDT),y) +QEMU_OPTS += --enable-fdt +QEMU_DEPENDENCIES += dtc +else +QEMU_OPTS += --disable-fdt +endif + +ifeq ($(BR2_PACKAGE_QEMU_TOOLS),y) +QEMU_OPTS += --enable-tools +else +QEMU_OPTS += --disable-tools +endif + +ifeq ($(BR2_PACKAGE_LIBSSH2),y) +QEMU_OPTS += --enable-libssh2 +QEMU_DEPENDENCIES += libssh2 +else +QEMU_OPTS += --disable-libssh2 +endif + +# Override CPP, as it expects to be able to call it like it'd +# call the compiler. +define QEMU_CONFIGURE_CMDS + ( cd $(@D); \ + LIBS='$(QEMU_LIBS)' \ + $(TARGET_CONFIGURE_OPTS) \ + $(TARGET_CONFIGURE_ARGS) \ + CPP="$(TARGET_CC) -E" \ + $(QEMU_VARS) \ + ./configure \ + --prefix=/usr \ + --cross-prefix=$(TARGET_CROSS) \ + --audio-drv-list= \ + --enable-kvm \ + --enable-attr \ + --enable-vhost-net \ + --disable-bsd-user \ + --disable-xen \ + --disable-slirp \ + --disable-vnc \ + --disable-virtfs \ + --disable-brlapi \ + --disable-curses \ + --disable-curl \ + --disable-bluez \ + --disable-vde \ + --disable-linux-aio \ + --disable-cap-ng \ + --disable-docs \ + --disable-spice \ + --disable-rbd \ + --disable-libiscsi \ + --disable-usb-redir \ + --disable-strip \ + --disable-seccomp \ + --disable-sparse \ + --disable-mpath \ + --disable-sanitizers \ + --disable-hvf \ + --disable-whpx \ + --disable-malloc-trim \ + --disable-membarrier \ + --disable-vhost-crypto \ + --disable-libxml2 \ + --disable-capstone \ + --disable-git-update \ + --disable-opengl \ + $(QEMU_OPTS) \ + ) +endef + +define QEMU_BUILD_CMDS + $(TARGET_MAKE_ENV) $(MAKE) -C $(@D) +endef + +define QEMU_INSTALL_TARGET_CMDS + $(TARGET_MAKE_ENV) $(MAKE) -C $(@D) $(QEMU_MAKE_ENV) DESTDIR=$(TARGET_DIR) install +endef + +$(eval $(generic-package)) + #------------------------------------------------------------- # Host-qemu @@ -148,124 +279,3 @@ $(eval $(host-generic-package)) # variable used by other packages QEMU_USER = $(HOST_DIR)/bin/qemu-$(HOST_QEMU_ARCH) - -#------------------------------------------------------------- -# Target-qemu - -QEMU_DEPENDENCIES = host-pkgconf host-python libglib2 zlib pixman - -# Need the LIBS variable because librt and libm are -# not automatically pulled. :-( -QEMU_LIBS = -lrt -lm - -QEMU_OPTS = - -QEMU_VARS = \ - LIBTOOL=$(HOST_DIR)/bin/libtool \ - PYTHON=$(HOST_DIR)/bin/python2 \ - PYTHONPATH=$(TARGET_DIR)/usr/lib/python$(PYTHON_VERSION_MAJOR)/site-packages - -# If we want to specify only a subset of targets, we must still enable all -# of them, so that QEMU properly builds its list of default targets, from -# which it then checks if the specified sub-set is valid. That's what we -# do in the first part of the if-clause. -# Otherwise, if we do not want to pass a sub-set of targets, we then need -# to either enable or disable -user and/or -system emulation appropriately. -# That's what we do in the else-clause. -ifneq ($(call qstrip,$(BR2_PACKAGE_QEMU_CUSTOM_TARGETS)),) -QEMU_OPTS += --enable-system --enable-linux-user -QEMU_OPTS += --target-list="$(call qstrip,$(BR2_PACKAGE_QEMU_CUSTOM_TARGETS))" -else - -ifeq ($(BR2_PACKAGE_QEMU_SYSTEM),y) -QEMU_OPTS += --enable-system -else -QEMU_OPTS += --disable-system -endif - -ifeq ($(BR2_PACKAGE_QEMU_LINUX_USER),y) -QEMU_OPTS += --enable-linux-user -else -QEMU_OPTS += --disable-linux-user -endif - -endif - -ifeq ($(BR2_PACKAGE_QEMU_SDL),y) -QEMU_OPTS += --enable-sdl -QEMU_DEPENDENCIES += sdl -QEMU_VARS += SDL_CONFIG=$(BR2_STAGING_DIR)/usr/bin/sdl-config -else -QEMU_OPTS += --disable-sdl -endif - -ifeq ($(BR2_PACKAGE_QEMU_FDT),y) -QEMU_OPTS += --enable-fdt -QEMU_DEPENDENCIES += dtc -else -QEMU_OPTS += --disable-fdt -endif - -ifeq ($(BR2_PACKAGE_QEMU_TOOLS),y) -QEMU_OPTS += --enable-tools -else -QEMU_OPTS += --disable-tools -endif - -ifeq ($(BR2_PACKAGE_LIBSSH2),y) -QEMU_OPTS += --enable-libssh2 -QEMU_DEPENDENCIES += libssh2 -else -QEMU_OPTS += --disable-libssh2 -endif - -# Override CPP, as it expects to be able to call it like it'd -# call the compiler. -define QEMU_CONFIGURE_CMDS - ( cd $(@D); \ - LIBS='$(QEMU_LIBS)' \ - $(TARGET_CONFIGURE_OPTS) \ - $(TARGET_CONFIGURE_ARGS) \ - CPP="$(TARGET_CC) -E" \ - $(QEMU_VARS) \ - ./configure \ - --prefix=/usr \ - --cross-prefix=$(TARGET_CROSS) \ - --with-system-pixman \ - --audio-drv-list= \ - --enable-kvm \ - --enable-attr \ - --enable-vhost-net \ - --disable-bsd-user \ - --disable-xen \ - --disable-slirp \ - --disable-vnc \ - --disable-virtfs \ - --disable-brlapi \ - --disable-curses \ - --disable-curl \ - --disable-bluez \ - --disable-vde \ - --disable-linux-aio \ - --disable-cap-ng \ - --disable-docs \ - --disable-spice \ - --disable-rbd \ - --disable-libiscsi \ - --disable-usb-redir \ - --disable-strip \ - --disable-seccomp \ - --disable-sparse \ - $(QEMU_OPTS) \ - ) -endef - -define QEMU_BUILD_CMDS - $(TARGET_MAKE_ENV) $(MAKE) -C $(@D) -endef - -define QEMU_INSTALL_TARGET_CMDS - $(TARGET_MAKE_ENV) $(MAKE) -C $(@D) $(QEMU_MAKE_ENV) DESTDIR=$(TARGET_DIR) install -endef - -$(eval $(generic-package)) diff --git a/bsp/buildroot/package/qt/Config.in b/bsp/buildroot/package/qt/Config.in index 0ecfafad..a1218ecf 100644 --- a/bsp/buildroot/package/qt/Config.in +++ b/bsp/buildroot/package/qt/Config.in @@ -309,9 +309,13 @@ choice config BR2_PACKAGE_QT_QTZLIB bool "Qt zlib" + depends on !BR2_STATIC_LIBS help Use the zlib bundled with Qt. +comment "Qt zlib needs a toolchain w/ dynamic library" + depends on BR2_STATIC_LIBS + config BR2_PACKAGE_QT_SYSTEMZLIB bool "System zlib" select BR2_PACKAGE_ZLIB diff --git a/bsp/buildroot/package/qt/qt.mk b/bsp/buildroot/package/qt/qt.mk index 921ff13d..23cb94c1 100644 --- a/bsp/buildroot/package/qt/qt.mk +++ b/bsp/buildroot/package/qt/qt.mk @@ -7,7 +7,7 @@ QT_VERSION_MAJOR = 4.8 QT_VERSION = $(QT_VERSION_MAJOR).7 QT_SOURCE = qt-everywhere-opensource-src-$(QT_VERSION).tar.gz -QT_SITE = http://download.qt-project.org/official_releases/qt/$(QT_VERSION_MAJOR)/$(QT_VERSION) +QT_SITE = http://download.qt.io/archive/qt/$(QT_VERSION_MAJOR)/$(QT_VERSION) QT_DEPENDENCIES = host-pkgconf QT_INSTALL_STAGING = YES diff --git a/bsp/buildroot/package/qt5/qt5base/qt5base.mk b/bsp/buildroot/package/qt5/qt5base/qt5base.mk index 53c98ce4..b79059c2 100644 --- a/bsp/buildroot/package/qt5/qt5base/qt5base.mk +++ b/bsp/buildroot/package/qt5/qt5base/qt5base.mk @@ -35,14 +35,21 @@ endif QT5BASE_CONFIGURE_OPTS += $(call qstrip,$(BR2_PACKAGE_QT5BASE_CUSTOM_CONF_OPTS)) -# Uses libgbm from mesa3d -ifeq ($(BR2_PACKAGE_MESA3D_OPENGL_EGL),y) -QT5BASE_CONFIGURE_OPTS += -kms -gbm -QT5BASE_DEPENDENCIES += mesa3d +ifeq ($(BR2_PACKAGE_LIBDRM),y) +QT5BASE_CONFIGURE_OPTS += -kms +QT5BASE_DEPENDENCIES += libdrm else QT5BASE_CONFIGURE_OPTS += -no-kms endif +# Uses libgbm from mesa3d +ifeq ($(BR2_PACKAGE_MESA3D_OPENGL_EGL),y) +QT5BASE_CONFIGURE_OPTS += -gbm +QT5BASE_DEPENDENCIES += mesa3d +else +QT5BASE_CONFIGURE_OPTS += -no-gbm +endif + ifeq ($(BR2_ENABLE_DEBUG),y) QT5BASE_CONFIGURE_OPTS += -debug else diff --git a/bsp/buildroot/package/rpm/rpm.mk b/bsp/buildroot/package/rpm/rpm.mk index 159ae72a..87c2059e 100644 --- a/bsp/buildroot/package/rpm/rpm.mk +++ b/bsp/buildroot/package/rpm/rpm.mk @@ -8,10 +8,10 @@ RPM_VERSION_MAJOR = 4.13 RPM_VERSION = $(RPM_VERSION_MAJOR).0.1 RPM_SOURCE = rpm-$(RPM_VERSION).tar.bz2 RPM_SITE = http://ftp.rpm.org/releases/rpm-$(RPM_VERSION_MAJOR).x -RPM_DEPENDENCIES = host-pkgconf berkeleydb file popt zlib +RPM_DEPENDENCIES = host-pkgconf berkeleydb file popt zlib \ + $(TARGET_NLS_DEPENDENCIES) RPM_LICENSE = GPL-2.0 or LGPL-2.0 (library only) RPM_LICENSE_FILES = COPYING -RPM_DEPENDENCIES = $(TARGET_NLS_DEPENDENCIES) # 0001-configure-ac-use-link-instead-of-compile-for-gcc-flags-test.patch # 0002-configure-ac-correct-stack-protector-check.patch diff --git a/bsp/buildroot/package/ruby/ruby.hash b/bsp/buildroot/package/ruby/ruby.hash index dd4cfc20..b36d4946 100644 --- a/bsp/buildroot/package/ruby/ruby.hash +++ b/bsp/buildroot/package/ruby/ruby.hash @@ -1,6 +1,6 @@ -# From https://www.ruby-lang.org/en/news/2018/03/28/ruby-2-4-4-released/ -sha256 1d0034071d675193ca769f64c91827e5f54cb3a7962316a41d5217c7bc6949f0 ruby-2.4.4.tar.xz +# https://www.ruby-lang.org/en/news/2018/10/17/ruby-2-4-5-released/ +sha256 2f0cdcce9989f63ef7c2939bdb17b1ef244c4f384d85b8531d60e73d8cc31eeb ruby-2.4.5.tar.xz # License files, Locally calculated -sha256 5cda9584acd5e1096276a375085b7e659fa67a072fd69ec2c3931e54f7f563bb LEGAL +sha256 609292a6d848ab223073944fc2d844449391a5ba2055a8b5baf1726bc13b39cb LEGAL sha256 f5eb1b2956d5f7a67b2e5722a3749bc2fe86f9c580f2e3f5a08519cf073b5864 COPYING sha256 a5e3042dacb53eebda91f3b1caefbfec8307711df8c4ed1ed20e4e97c43307a4 BSDL diff --git a/bsp/buildroot/package/ruby/ruby.mk b/bsp/buildroot/package/ruby/ruby.mk index 93c3170c..d6e5fdb4 100644 --- a/bsp/buildroot/package/ruby/ruby.mk +++ b/bsp/buildroot/package/ruby/ruby.mk @@ -5,7 +5,7 @@ ################################################################################ RUBY_VERSION_MAJOR = 2.4 -RUBY_VERSION = $(RUBY_VERSION_MAJOR).4 +RUBY_VERSION = $(RUBY_VERSION_MAJOR).5 RUBY_VERSION_EXT = 2.4.0 RUBY_SITE = http://cache.ruby-lang.org/pub/ruby/$(RUBY_VERSION_MAJOR) RUBY_SOURCE = ruby-$(RUBY_VERSION).tar.xz diff --git a/bsp/buildroot/package/samba4/samba4.mk b/bsp/buildroot/package/samba4/samba4.mk index 03ef6eee..83a02d54 100644 --- a/bsp/buildroot/package/samba4/samba4.mk +++ b/bsp/buildroot/package/samba4/samba4.mk @@ -150,13 +150,12 @@ define SAMBA4_INSTALL_INIT_SYSV $(TARGET_DIR)/etc/init.d/S91smb endef +ifeq ($(BR2_INIT_SYSTEMD),y) +SAMBA4_CONF_OPTS += --systemd-install-services +SAMBA4_DEPENDENCIES += systemd +endif + define SAMBA4_INSTALL_INIT_SYSTEMD - $(INSTALL) -D -m 644 $(@D)/packaging/systemd/nmb.service \ - $(TARGET_DIR)/usr/lib/systemd/system/nmb.service - $(INSTALL) -D -m 644 $(@D)/packaging/systemd/smb.service \ - $(TARGET_DIR)/usr/lib/systemd/system/smb.service - $(INSTALL) -D -m 644 $(@D)/packaging/systemd/winbind.service \ - $(TARGET_DIR)/usr/lib/systemd/system/winbind.service mkdir -p $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants ln -sf ../../../../usr/lib/systemd/system/nmb.service \ $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants/nmb.service diff --git a/bsp/buildroot/package/setools/setools.mk b/bsp/buildroot/package/setools/setools.mk index 6748c95c..c152e541 100644 --- a/bsp/buildroot/package/setools/setools.mk +++ b/bsp/buildroot/package/setools/setools.mk @@ -18,6 +18,7 @@ SETOOLS_PYLIBVER = python$(PYTHON3_VERSION_MAJOR) else SETOOLS_PYLIBVER = python$(PYTHON_VERSION_MAJOR) SETOOLS_DEPENDENCIES += python-enum34 +HOST_SETOOLS_DEPENDENCIES += host-python-enum34 endif define SETOOLS_FIX_SETUP diff --git a/bsp/buildroot/package/spice-protocol/spice-protocol.hash b/bsp/buildroot/package/spice-protocol/spice-protocol.hash index c75c095c..e72bb2d7 100644 --- a/bsp/buildroot/package/spice-protocol/spice-protocol.hash +++ b/bsp/buildroot/package/spice-protocol/spice-protocol.hash @@ -1,2 +1,2 @@ # Locally calculated after checking pgp signature -sha256 788f0d7195bec5b14371732b562eb55ca82712aab12273b0e87529fb30532efb spice-protocol-0.12.10.tar.bz2 +sha256 20350bc4309039fdf0d29ee4fd0033cde27bccf33501e13b3c1befafde9d0c9c spice-protocol-0.12.14.tar.bz2 diff --git a/bsp/buildroot/package/spice-protocol/spice-protocol.mk b/bsp/buildroot/package/spice-protocol/spice-protocol.mk index dcc6feeb..7392e953 100644 --- a/bsp/buildroot/package/spice-protocol/spice-protocol.mk +++ b/bsp/buildroot/package/spice-protocol/spice-protocol.mk @@ -4,7 +4,7 @@ # ################################################################################ -SPICE_PROTOCOL_VERSION = 0.12.10 +SPICE_PROTOCOL_VERSION = 0.12.14 SPICE_PROTOCOL_SOURCE = spice-protocol-$(SPICE_PROTOCOL_VERSION).tar.bz2 SPICE_PROTOCOL_SITE = http://www.spice-space.org/download/releases SPICE_PROTOCOL_LICENSE = BSD-3-Clause diff --git a/bsp/buildroot/package/spice/0001-Prevent-possible-DoS-attempts-during-protocol-handsh.patch b/bsp/buildroot/package/spice/0001-Prevent-possible-DoS-attempts-during-protocol-handsh.patch deleted file mode 100644 index 57a64d96..00000000 --- a/bsp/buildroot/package/spice/0001-Prevent-possible-DoS-attempts-during-protocol-handsh.patch +++ /dev/null @@ -1,60 +0,0 @@ -From 1c6517973095a67c8cb57f3550fc1298404ab556 Mon Sep 17 00:00:00 2001 -From: Frediano Ziglio -Date: Tue, 13 Dec 2016 14:39:48 +0000 -Subject: [PATCH] Prevent possible DoS attempts during protocol handshake - -The limit for link message is specified using a 32 bit unsigned integer. -This could cause possible DoS due to excessive memory allocations and -some possible crashes. -For instance a value >= 2^31 causes a spice_assert to be triggered in -async_read_handler (reds-stream.c) due to an integer overflow at this -line: - - int n = async->end - async->now; - -This could be easily triggered with a program like - - #!/usr/bin/env python - - import socket - import time - from struct import pack - - server = '127.0.0.1' - port = 5900 - - s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) - s.connect((server, port)) - data = pack('<4sIII', 'REDQ', 2, 2, 0xaaaaaaaa) - s.send(data) - - time.sleep(1) - -without requiring any authentication (the same can be done -with TLS). - -[Peter: fixes CVE-2016-9578] -Signed-off-by: Frediano Ziglio -Acked-by: Christophe Fergeau -Signed-off-by: Peter Korsgaard ---- - server/reds.c | 3 ++- - 1 file changed, 2 insertions(+), 1 deletion(-) - -diff --git a/server/reds.c b/server/reds.c -index f40b65c1..86a33d53 100644 ---- a/server/reds.c -+++ b/server/reds.c -@@ -2202,7 +2202,8 @@ static void reds_handle_read_header_done(void *opaque) - - reds->peer_minor_version = header->minor_version; - -- if (header->size < sizeof(SpiceLinkMess)) { -+ /* the check for 4096 is to avoid clients to cause arbitrary big memory allocations */ -+ if (header->size < sizeof(SpiceLinkMess) || header->size > 4096) { - reds_send_link_error(link, SPICE_LINK_ERR_INVALID_DATA); - spice_warning("bad size %u", header->size); - reds_link_free(link); --- -2.11.0 - diff --git a/bsp/buildroot/package/spice/0002-Prevent-integer-overflows-in-capability-checks.patch b/bsp/buildroot/package/spice/0002-Prevent-integer-overflows-in-capability-checks.patch deleted file mode 100644 index 5bf9b89d..00000000 --- a/bsp/buildroot/package/spice/0002-Prevent-integer-overflows-in-capability-checks.patch +++ /dev/null @@ -1,43 +0,0 @@ -From f66dc643635518e53dfbe5262f814a64eec54e4a Mon Sep 17 00:00:00 2001 -From: Frediano Ziglio -Date: Tue, 13 Dec 2016 14:40:10 +0000 -Subject: [PATCH] Prevent integer overflows in capability checks - -The limits for capabilities are specified using 32 bit unsigned integers. -This could cause possible integer overflows causing buffer overflows. -For instance the sum of num_common_caps and num_caps can be 0 avoiding -additional checks. -As the link message is now capped to 4096 and the capabilities are -contained in the link message limit the capabilities to 1024 -(capabilities are expressed in number of uint32_t items). - -[Peter: fixes CVE-2016-9578] -Signed-off-by: Frediano Ziglio -Acked-by: Christophe Fergeau -Signed-off-by: Peter Korsgaard ---- - server/reds.c | 8 ++++++++ - 1 file changed, 8 insertions(+) - -diff --git a/server/reds.c b/server/reds.c -index 86a33d53..91504544 100644 ---- a/server/reds.c -+++ b/server/reds.c -@@ -2110,6 +2110,14 @@ static void reds_handle_read_link_done(void *opaque) - link_mess->num_channel_caps = GUINT32_FROM_LE(link_mess->num_channel_caps); - link_mess->num_common_caps = GUINT32_FROM_LE(link_mess->num_common_caps); - -+ /* Prevent DoS. Currently we defined only 13 capabilities, -+ * I expect 1024 to be valid for quite a lot time */ -+ if (link_mess->num_channel_caps > 1024 || link_mess->num_common_caps > 1024) { -+ reds_send_link_error(link, SPICE_LINK_ERR_INVALID_DATA); -+ reds_link_free(link); -+ return; -+ } -+ - num_caps = link_mess->num_common_caps + link_mess->num_channel_caps; - caps = (uint32_t *)((uint8_t *)link_mess + link_mess->caps_offset); - --- -2.11.0 - diff --git a/bsp/buildroot/package/spice/0003-main-channel-Prevent-overflow-reading-messages-from-.patch b/bsp/buildroot/package/spice/0003-main-channel-Prevent-overflow-reading-messages-from-.patch deleted file mode 100644 index f602d5f3..00000000 --- a/bsp/buildroot/package/spice/0003-main-channel-Prevent-overflow-reading-messages-from-.patch +++ /dev/null @@ -1,33 +0,0 @@ -From 5f96b596353d73bdf4bb3cd2de61e48a7fd5b4c3 Mon Sep 17 00:00:00 2001 -From: Frediano Ziglio -Date: Tue, 29 Nov 2016 16:46:56 +0000 -Subject: [PATCH] main-channel: Prevent overflow reading messages from client - -Caller is supposed the function return a buffer able to store -size bytes. - -[Peter: fixes CVE-2016-9577] -Signed-off-by: Frediano Ziglio -Acked-by: Christophe Fergeau -Signed-off-by: Peter Korsgaard ---- - server/main_channel.c | 3 +++ - 1 file changed, 3 insertions(+) - -diff --git a/server/main_channel.c b/server/main_channel.c -index 0ecc9df8..1fc39155 100644 ---- a/server/main_channel.c -+++ b/server/main_channel.c -@@ -1026,6 +1026,9 @@ static uint8_t *main_channel_alloc_msg_rcv_buf(RedChannelClient *rcc, - - if (type == SPICE_MSGC_MAIN_AGENT_DATA) { - return reds_get_agent_data_buffer(mcc, size); -+ } else if (size > sizeof(main_chan->recv_buf)) { -+ /* message too large, caller will log a message and close the connection */ -+ return NULL; - } else { - return main_chan->recv_buf; - } --- -2.11.0 - diff --git a/bsp/buildroot/package/spice/0004-reds-Disconnect-when-receiving-overly-big-ClientMoni.patch b/bsp/buildroot/package/spice/0004-reds-Disconnect-when-receiving-overly-big-ClientMoni.patch deleted file mode 100644 index 070259f2..00000000 --- a/bsp/buildroot/package/spice/0004-reds-Disconnect-when-receiving-overly-big-ClientMoni.patch +++ /dev/null @@ -1,75 +0,0 @@ -From f1e7ec03e26ab6b8ca9b7ec060846a5b706a963d Mon Sep 17 00:00:00 2001 -From: Frediano Ziglio -Date: Mon, 15 May 2017 15:57:28 +0100 -Subject: [PATCH] reds: Disconnect when receiving overly big - ClientMonitorsConfig - -Total message size received from the client was unlimited. There is -a 2kiB size check on individual agent messages, but the MonitorsConfig -message can be split in multiple chunks, and the size of the -non-chunked MonitorsConfig message was never checked. This could easily -lead to memory exhaustion on the host. - -Signed-off-by: Frediano Ziglio -Signed-off-by: Peter Korsgaard ---- - server/reds.c | 25 +++++++++++++++++++++++-- - 1 file changed, 23 insertions(+), 2 deletions(-) - -diff --git a/server/reds.c b/server/reds.c -index f439a366..7be85fdf 100644 ---- a/server/reds.c -+++ b/server/reds.c -@@ -993,19 +993,34 @@ static void reds_client_monitors_config_cleanup(void) - static void reds_on_main_agent_monitors_config( - MainChannelClient *mcc, void *message, size_t size) - { -+ const unsigned int MAX_MONITORS = 256; -+ const unsigned int MAX_MONITOR_CONFIG_SIZE = -+ sizeof(VDAgentMonitorsConfig) + MAX_MONITORS * sizeof(VDAgentMonConfig); -+ - VDAgentMessage *msg_header; - VDAgentMonitorsConfig *monitors_config; - RedsClientMonitorsConfig *cmc = &reds->client_monitors_config; - -+ // limit size of message sent by the client as this can cause a DoS through -+ // memory exhaustion, or potentially some integer overflows -+ if (sizeof(VDAgentMessage) + MAX_MONITOR_CONFIG_SIZE - cmc->buffer_size < size) { -+ goto overflow; -+ } - cmc->buffer_size += size; - cmc->buffer = realloc(cmc->buffer, cmc->buffer_size); - spice_assert(cmc->buffer); - cmc->mcc = mcc; - memcpy(cmc->buffer + cmc->buffer_pos, message, size); - cmc->buffer_pos += size; -+ if (sizeof(VDAgentMessage) > cmc->buffer_size) { -+ spice_debug("not enough data yet. %d", cmc->buffer_size); -+ return; -+ } - msg_header = (VDAgentMessage *)cmc->buffer; -- if (sizeof(VDAgentMessage) > cmc->buffer_size || -- msg_header->size > cmc->buffer_size - sizeof(VDAgentMessage)) { -+ if (msg_header->size > MAX_MONITOR_CONFIG_SIZE) { -+ goto overflow; -+ } -+ if (msg_header->size > cmc->buffer_size - sizeof(VDAgentMessage)) { - spice_debug("not enough data yet. %d", cmc->buffer_size); - return; - } -@@ -1013,6 +1028,12 @@ static void reds_on_main_agent_monitors_config( - spice_debug("%s: %d", __func__, monitors_config->num_of_monitors); - red_dispatcher_client_monitors_config(monitors_config); - reds_client_monitors_config_cleanup(); -+ return; -+ -+overflow: -+ spice_warning("received invalid MonitorsConfig request from client, disconnecting"); -+ red_channel_client_disconnect(main_channel_client_get_base(mcc)); -+ reds_client_monitors_config_cleanup(); - } - - void reds_on_main_agent_data(MainChannelClient *mcc, void *message, size_t size) --- -2.11.0 - diff --git a/bsp/buildroot/package/spice/0005-reds-Avoid-integer-overflows-handling-monitor-config.patch b/bsp/buildroot/package/spice/0005-reds-Avoid-integer-overflows-handling-monitor-config.patch deleted file mode 100644 index 98740520..00000000 --- a/bsp/buildroot/package/spice/0005-reds-Avoid-integer-overflows-handling-monitor-config.patch +++ /dev/null @@ -1,31 +0,0 @@ -From ec6229c79abe05d731953df5f7e9a05ec9f6df79 Mon Sep 17 00:00:00 2001 -From: Frediano Ziglio -Date: Mon, 15 May 2017 15:57:28 +0100 -Subject: [PATCH] reds: Avoid integer overflows handling monitor - configuration - -Avoid VDAgentMessage::size integer overflows. - -Signed-off-by: Frediano Ziglio -Signed-off-by: Peter Korsgaard ---- - server/reds.c | 3 +++ - 1 file changed, 3 insertions(+) - -diff --git a/server/reds.c b/server/reds.c -index 7be85fdf..e1c8c108 100644 ---- a/server/reds.c -+++ b/server/reds.c -@@ -1024,6 +1024,9 @@ static void reds_on_main_agent_monitors_config( - spice_debug("not enough data yet. %d", cmc->buffer_size); - return; - } -+ if (msg_header->size < sizeof(VDAgentMonitorsConfig)) { -+ goto overflow; -+ } - monitors_config = (VDAgentMonitorsConfig *)(cmc->buffer + sizeof(*msg_header)); - spice_debug("%s: %d", __func__, monitors_config->num_of_monitors); - red_dispatcher_client_monitors_config(monitors_config); --- -2.11.0 - diff --git a/bsp/buildroot/package/spice/0006-reds-Avoid-buffer-overflows-handling-monitor-configu.patch b/bsp/buildroot/package/spice/0006-reds-Avoid-buffer-overflows-handling-monitor-configu.patch deleted file mode 100644 index 212645b4..00000000 --- a/bsp/buildroot/package/spice/0006-reds-Avoid-buffer-overflows-handling-monitor-configu.patch +++ /dev/null @@ -1,48 +0,0 @@ -From a957a90baf2c62d31f3547e56bba7d0e812d2331 Mon Sep 17 00:00:00 2001 -From: Frediano Ziglio -Date: Mon, 15 May 2017 15:57:28 +0100 -Subject: [PATCH] reds: Avoid buffer overflows handling monitor - configuration - -It was also possible for a malicious client to set -VDAgentMonitorsConfig::num_of_monitors to a number larger -than the actual size of VDAgentMOnitorsConfig::monitors. -This would lead to buffer overflows, which could allow the guest to -read part of the host memory. This might cause write overflows in the -host as well, but controlling the content of such buffers seems -complicated. - -Signed-off-by: Frediano Ziglio -Signed-off-by: Peter Korsgaard ---- - server/reds.c | 7 +++++++ - 1 file changed, 7 insertions(+) - -diff --git a/server/reds.c b/server/reds.c -index e1c8c108..3a42c375 100644 ---- a/server/reds.c -+++ b/server/reds.c -@@ -1000,6 +1000,7 @@ static void reds_on_main_agent_monitors_config( - VDAgentMessage *msg_header; - VDAgentMonitorsConfig *monitors_config; - RedsClientMonitorsConfig *cmc = &reds->client_monitors_config; -+ uint32_t max_monitors; - - // limit size of message sent by the client as this can cause a DoS through - // memory exhaustion, or potentially some integer overflows -@@ -1028,6 +1029,12 @@ static void reds_on_main_agent_monitors_config( - goto overflow; - } - monitors_config = (VDAgentMonitorsConfig *)(cmc->buffer + sizeof(*msg_header)); -+ // limit the monitor number to avoid buffer overflows -+ max_monitors = (msg_header->size - sizeof(VDAgentMonitorsConfig)) / -+ sizeof(VDAgentMonConfig); -+ if (monitors_config->num_of_monitors > max_monitors) { -+ goto overflow; -+ } - spice_debug("%s: %d", __func__, monitors_config->num_of_monitors); - red_dispatcher_client_monitors_config(monitors_config); - reds_client_monitors_config_cleanup(); --- -2.11.0 - diff --git a/bsp/buildroot/package/spice/spice.hash b/bsp/buildroot/package/spice/spice.hash index c9b591f4..1a25926a 100644 --- a/bsp/buildroot/package/spice/spice.hash +++ b/bsp/buildroot/package/spice/spice.hash @@ -1,2 +1,2 @@ # Locally calculated -sha256 f901a5c5873d61acac84642f9eea5c4d6386fc3e525c2b68792322794e1c407d spice-0.12.8.tar.bz2 +sha256 1ead5de63d06eededed4017db37240f07bef0abffbaf621899647e7e685a1519 spice-0.14.1.tar.bz2 diff --git a/bsp/buildroot/package/spice/spice.mk b/bsp/buildroot/package/spice/spice.mk index 7b09f39f..16e57441 100644 --- a/bsp/buildroot/package/spice/spice.mk +++ b/bsp/buildroot/package/spice/spice.mk @@ -4,13 +4,14 @@ # ################################################################################ -SPICE_VERSION = 0.12.8 +SPICE_VERSION = 0.14.1 SPICE_SOURCE = spice-$(SPICE_VERSION).tar.bz2 -SPICE_SITE = http://www.spice-space.org/download/releases +SPICE_SITE = http://www.spice-space.org/download/releases/spice-server SPICE_LICENSE = LGPL-2.1+ SPICE_LICENSE_FILES = COPYING SPICE_INSTALL_STAGING = YES SPICE_DEPENDENCIES = \ + host-pkgconf \ jpeg \ libglib2 \ openssl \ @@ -20,9 +21,9 @@ SPICE_DEPENDENCIES = \ # We disable everything for now, because the dependency tree can become # quite deep if we try to enable some features, and I have not tested that. SPICE_CONF_OPTS = \ + --disable-gstreamer \ --disable-opengl \ --disable-smartcard \ - --disable-automated-tests \ --without-sasl \ --disable-manual @@ -42,6 +43,13 @@ else SPICE_CONF_OPTS += --disable-lz4 endif +ifeq ($(BR2_PACKAGE_OPUS),y) +SPICE_CONF_OPTS += --enable-opus +SPICE_DEPENDENCIES += opus +else +SPICE_CONF_OPTS += --disable-opus +endif + # no enable/disable, detected using pkg-config ifeq ($(BR2_PACKAGE_OPUS),y) SPICE_DEPENDENCIES += opus diff --git a/bsp/buildroot/package/squid/0003-ESI-make-sure-endofName-never-exceeds-tagEnd-130.patch b/bsp/buildroot/package/squid/0003-ESI-make-sure-endofName-never-exceeds-tagEnd-130.patch deleted file mode 100644 index 6e71677a..00000000 --- a/bsp/buildroot/package/squid/0003-ESI-make-sure-endofName-never-exceeds-tagEnd-130.patch +++ /dev/null @@ -1,35 +0,0 @@ -From eb2db98a676321b814fc4a51c4fb7928a8bb45d9 Mon Sep 17 00:00:00 2001 -From: Amos Jeffries -Date: Fri, 19 Jan 2018 13:54:14 +1300 -Subject: [PATCH] ESI: make sure endofName never exceeds tagEnd (#130) - -Signed-off-by: Peter Korsgaard ---- - src/esi/CustomParser.cc | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/src/esi/CustomParser.cc b/src/esi/CustomParser.cc -index d86d2d309..db634d921 100644 ---- a/src/esi/CustomParser.cc -+++ b/src/esi/CustomParser.cc -@@ -121,7 +121,7 @@ ESICustomParser::parse(char const *dataToParse, size_t const lengthOfData, bool - - char * endofName = strpbrk(const_cast(tag), w_space); - -- if (endofName > tagEnd) -+ if (!endofName || endofName > tagEnd) - endofName = const_cast(tagEnd); - - *endofName = '\0'; -@@ -214,7 +214,7 @@ ESICustomParser::parse(char const *dataToParse, size_t const lengthOfData, bool - - char * endofName = strpbrk(const_cast(tag), w_space); - -- if (endofName > tagEnd) -+ if (!endofName || endofName > tagEnd) - endofName = const_cast(tagEnd); - - *endofName = '\0'; --- -2.11.0 - diff --git a/bsp/buildroot/package/squid/0004-Fix-indirect-IP-logging-for-transactions-without-a-c.patch b/bsp/buildroot/package/squid/0004-Fix-indirect-IP-logging-for-transactions-without-a-c.patch deleted file mode 100644 index 51fff300..00000000 --- a/bsp/buildroot/package/squid/0004-Fix-indirect-IP-logging-for-transactions-without-a-c.patch +++ /dev/null @@ -1,31 +0,0 @@ -From 8232b83d3fa47a1399f155cb829db829369fbae9 Mon Sep 17 00:00:00 2001 -From: squidadm -Date: Sun, 21 Jan 2018 08:07:08 +1300 -Subject: [PATCH] Fix indirect IP logging for transactions without a client - connection (#129) (#136) - -Signed-off-by: Peter Korsgaard ---- - src/client_side_request.cc | 6 +++--- - 1 file changed, 3 insertions(+), 3 deletions(-) - -diff --git a/src/client_side_request.cc b/src/client_side_request.cc -index be124f355..203f89d46 100644 ---- a/src/client_side_request.cc -+++ b/src/client_side_request.cc -@@ -488,9 +488,9 @@ clientFollowXForwardedForCheck(allow_t answer, void *data) - * Ensure that the access log shows the indirect client - * instead of the direct client. - */ -- ConnStateData *conn = http->getConn(); -- conn->log_addr = request->indirect_client_addr; -- http->al->cache.caddr = conn->log_addr; -+ http->al->cache.caddr = request->indirect_client_addr; -+ if (ConnStateData *conn = http->getConn()) -+ conn->log_addr = request->indirect_client_addr; - } - request->x_forwarded_for_iterator.clean(); - request->flags.done_follow_x_forwarded_for = true; --- -2.11.0 - diff --git a/bsp/buildroot/package/squid/squid.hash b/bsp/buildroot/package/squid/squid.hash index 8787cb25..74637ca0 100644 --- a/bsp/buildroot/package/squid/squid.hash +++ b/bsp/buildroot/package/squid/squid.hash @@ -1,5 +1,7 @@ -# From http://www.squid-cache.org/Versions/v3/3.5/squid-3.5.27.tar.xz.asc -md5 39ef8199675d48a314b540f92c00c545 squid-3.5.27.tar.xz -sha1 1e69c96d13cd49844da3bcf33a0b428fbe7b6f77 squid-3.5.27.tar.xz +# From http://www.squid-cache.org/Versions/v3/3.5/squid-3.5.28.tar.xz.asc +md5 9367e0375ea53ba0e99f77054d4402c5 squid-3.5.28.tar.xz +sha1 721241a270ec27d629d65ae17a50be56510e8441 squid-3.5.28.tar.xz # Locally calculated +sha256 de5ea6fa5711aaa6d209de9e9e715c2702ff3597f009562ee1e571cc101670c7 squid-3.5-f1657a9decc820f748fa3aff68168d3145258031.patch +sha256 8f2518b5e9840e119c493f6ed793e773675e2f768de2bf1bd637fced27e4d527 squid-3.5-bc9786119f058a76ddf0625424bc33d36460b9a2.patch sha256 58f5d05257af1fb964fde20e134d660fac9afa86b6fd8c70d63ead63068378fa COPYING diff --git a/bsp/buildroot/package/squid/squid.mk b/bsp/buildroot/package/squid/squid.mk index 8ade55ee..8be41357 100644 --- a/bsp/buildroot/package/squid/squid.mk +++ b/bsp/buildroot/package/squid/squid.mk @@ -5,9 +5,12 @@ ################################################################################ SQUID_VERSION_MAJOR = 3.5 -SQUID_VERSION = $(SQUID_VERSION_MAJOR).27 +SQUID_VERSION = $(SQUID_VERSION_MAJOR).28 SQUID_SOURCE = squid-$(SQUID_VERSION).tar.xz SQUID_SITE = http://www.squid-cache.org/Versions/v3/$(SQUID_VERSION_MAJOR) +SQUID_PATCH = \ + http://www.squid-cache.org/Versions/v3/3.5/changesets/squid-3.5-f1657a9decc820f748fa3aff68168d3145258031.patch \ + http://www.squid-cache.org/Versions/v3/3.5/changesets/squid-3.5-bc9786119f058a76ddf0625424bc33d36460b9a2.patch SQUID_LICENSE = GPL-2.0+ SQUID_LICENSE_FILES = COPYING # For 0001-assume-get-certificate-ok.patch diff --git a/bsp/buildroot/package/supertuxkart/0001-Fix-3091.patch b/bsp/buildroot/package/supertuxkart/0001-Fix-3091.patch new file mode 100644 index 00000000..dae2a37c --- /dev/null +++ b/bsp/buildroot/package/supertuxkart/0001-Fix-3091.patch @@ -0,0 +1,59 @@ +From 813b08bc73e4e93714b972ee56c64b4771735e01 Mon Sep 17 00:00:00 2001 +From: Benau +Date: Sun, 14 Jan 2018 10:19:37 +0800 +Subject: [PATCH] Fix #3091 + +Signed-off-by: Fabrice Fontaine + #define CPU_MMX_SUPPORT (1) + #endif +-#if __SSE__ || _M_X64 || _M_IX86_FP >= 1 || CPU_ENABLE_SSE ++#if __SSE__ || defined(_M_X64) || ( defined(_M_IX86_FP) && ( _M_IX86_FP >= 1 ) ) || CPU_ENABLE_SSE + #include + #define CPU_SSE_SUPPORT (1) + #endif +-#if __SSE2__ || _M_X64 || _M_IX86_FP >= 2 || CPU_ENABLE_SSE2 ++#if __SSE2__ || defined(_M_X64) || ( defined(_M_IX86_FP) && ( _M_IX86_FP >= 2 ) ) || CPU_ENABLE_SSE2 + #include + #define CPU_SSE2_SUPPORT (1) + #endif +@@ -95,23 +95,23 @@ + #define CPU_POPCNT_SUPPORT (1) + #endif + #if __LZCNT__ || CPU_ENABLE_LZCNT +- #include ++ #include + #define CPU_LZCNT_SUPPORT (1) + #endif + #if __F16C__ || CPU_ENABLE_F16C +- #include ++ #include + #define CPU_F16C_SUPPORT (1) + #endif + #if __BMI__ || CPU_ENABLE_BMI +- #include ++ #include + #define CPU_BMI_SUPPORT (1) + #endif + #if __BMI2__ || CPU_ENABLE_BMI2 +- #include ++ #include + #define CPU_BMI2_SUPPORT (1) + #endif + #if __TBM__ || CPU_ENABLE_TBM +- #include ++ #include + #define CPU_TBM_SUPPORT (1) + #endif + diff --git a/bsp/buildroot/package/systemd/0005-dhcp6-make-sure-we-have-enough-space-for-the-DHCP6-o.patch b/bsp/buildroot/package/systemd/0005-dhcp6-make-sure-we-have-enough-space-for-the-DHCP6-o.patch new file mode 100644 index 00000000..6a72a389 --- /dev/null +++ b/bsp/buildroot/package/systemd/0005-dhcp6-make-sure-we-have-enough-space-for-the-DHCP6-o.patch @@ -0,0 +1,30 @@ +From 49653743f69658aeeebdb14faf1ab158f1f2cb20 Mon Sep 17 00:00:00 2001 +From: Lennart Poettering +Date: Fri, 19 Oct 2018 12:12:33 +0200 +Subject: [PATCH] dhcp6: make sure we have enough space for the DHCP6 option + header + +Fixes CVE-2018-15688: +https://security-tracker.debian.org/tracker/CVE-2018-15688 + +Patch downloaded from upstream commit: +https://github.com/systemd/systemd/commit/49653743f69658aeeebdb14faf1ab158f1f2cb20 + +Signed-off-by: Bernd Kuhls +--- + src/libsystemd-network/dhcp6-option.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/libsystemd-network/dhcp6-option.c b/src/libsystemd-network/dhcp6-option.c +index cbd4bc7a2a3..2806415100c 100644 +--- a/src/libsystemd-network/dhcp6-option.c ++++ b/src/libsystemd-network/dhcp6-option.c +@@ -106,7 +106,7 @@ int dhcp6_option_append_ia(uint8_t **buf, size_t *buflen, const DHCP6IA *ia) { + return -EINVAL; + } + +- if (*buflen < len) ++ if (*buflen < offsetof(DHCP6Option, data) + len) + return -ENOBUFS; + + ia_hdr = *buf; diff --git a/bsp/buildroot/package/tar/Config.in b/bsp/buildroot/package/tar/Config.in index b0be7a38..caf12d6f 100644 --- a/bsp/buildroot/package/tar/Config.in +++ b/bsp/buildroot/package/tar/Config.in @@ -12,4 +12,5 @@ config BR2_PACKAGE_TAR comment "tar needs a toolchain w/ wchar" depends on !BR2_USE_WCHAR + depends on BR2_USE_MMU depends on BR2_PACKAGE_BUSYBOX_SHOW_OTHERS diff --git a/bsp/buildroot/package/tinc/tinc.hash b/bsp/buildroot/package/tinc/tinc.hash index b0cdde83..0daeb324 100644 --- a/bsp/buildroot/package/tinc/tinc.hash +++ b/bsp/buildroot/package/tinc/tinc.hash @@ -1,4 +1,4 @@ # Locally calculated after checking pgp signature -sha256 7f6f5dc6444bc651ac635c81f4745bcce581bbd1d45ed60cbdc4ee11bebb10f4 tinc-1.0.33.tar.gz -sha256 10618781fe68ee0958d627f9f4b279b55eaff6c852f7742bbef64dc470c0077c COPYING +sha256 18c83b147cc3e2133a7ac2543eeb014d52070de01c7474287d3ccecc9b16895e tinc-1.0.35.tar.gz +sha256 3a112fd37b47d624e89b130d0e158bb8d14ec5bc9ecf5f18b448d2c07626e43d COPYING sha256 9bf76a8aa304d807df20bf3d221c21d259764be63e39b58f299b80ba3ac14b5b COPYING.README diff --git a/bsp/buildroot/package/tinc/tinc.mk b/bsp/buildroot/package/tinc/tinc.mk index 00278530..ae7ce97b 100644 --- a/bsp/buildroot/package/tinc/tinc.mk +++ b/bsp/buildroot/package/tinc/tinc.mk @@ -4,7 +4,7 @@ # ################################################################################ -TINC_VERSION = 1.0.33 +TINC_VERSION = 1.0.35 TINC_SITE = http://www.tinc-vpn.org/packages TINC_DEPENDENCIES = lzo openssl zlib TINC_LICENSE = GPL-2.0+ with OpenSSL exception diff --git a/bsp/buildroot/package/trace-cmd/trace-cmd.mk b/bsp/buildroot/package/trace-cmd/trace-cmd.mk index 0dc14567..578e9f12 100644 --- a/bsp/buildroot/package/trace-cmd/trace-cmd.mk +++ b/bsp/buildroot/package/trace-cmd/trace-cmd.mk @@ -5,7 +5,7 @@ ################################################################################ TRACE_CMD_VERSION = trace-cmd-v2.6.1 -TRACE_CMD_SITE = $(BR2_KERNEL_MIRROR)/scm/linux/kernel/git/rostedt/trace-cmd.git +TRACE_CMD_SITE = https://git.kernel.org/pub/scm/linux/kernel/git/rostedt/trace-cmd.git TRACE_CMD_SITE_METHOD = git TRACE_CMD_INSTALL_STAGING = YES TRACE_CMD_LICENSE = GPL-2.0, LGPL-2.1 diff --git a/bsp/buildroot/package/traceroute/traceroute.mk b/bsp/buildroot/package/traceroute/traceroute.mk index d01c62d5..367e3c7a 100644 --- a/bsp/buildroot/package/traceroute/traceroute.mk +++ b/bsp/buildroot/package/traceroute/traceroute.mk @@ -16,7 +16,7 @@ TRACEROUTE_DEPENDENCIES += busybox endif define TRACEROUTE_BUILD_CMDS - $(TARGET_MAKE_ENV) $(MAKE) $(TARGET_CONFIGURE_OPTS) \ + $(TARGET_MAKE_ENV) VPATH=$(STAGING_DIR)/usr/lib $(MAKE) $(TARGET_CONFIGURE_OPTS) \ CFLAGS="$(TARGET_CFLAGS) -D_GNU_SOURCE" -C $(@D) endef diff --git a/bsp/buildroot/package/twolame/0001-Fix-static-linking-with-libmagic.patch b/bsp/buildroot/package/twolame/0001-Fix-static-linking-with-libmagic.patch new file mode 100644 index 00000000..094d7e99 --- /dev/null +++ b/bsp/buildroot/package/twolame/0001-Fix-static-linking-with-libmagic.patch @@ -0,0 +1,228 @@ +From 484275de103b2214cb8ff3868a2562e2c61ce0e1 Mon Sep 17 00:00:00 2001 +From: Fabrice Fontaine +Date: Thu, 8 Nov 2018 20:57:08 +0100 +Subject: [PATCH] Fix static linking with libmagic + +libmagic (from file package) already provides the buffer_init function +so to avoid a build failure for applications wanting to statically link +with twolame and libmagic (for example sox), rename buffer_init into +bitbuffer_init (also rename buffer_deinit into bitbuffer_deinit and +buffer_sstell into bitbuffer_sstell for consistency) + +Fixes: + - http://autobuild.buildroot.org/results/b3fc62e7f372fe595966e84091c11ccdb4cfa77c + +Signed-off-by: Fabrice Fontaine +[Upstream status: https://github.com/njh/twolame/pull/81] +--- + libtwolame/bitbuffer.c | 4 ++-- + libtwolame/bitbuffer.h | 6 +++--- + libtwolame/energy.c | 2 +- + libtwolame/twolame.c | 32 ++++++++++++++++---------------- + 4 files changed, 22 insertions(+), 22 deletions(-) + +diff --git a/libtwolame/bitbuffer.c b/libtwolame/bitbuffer.c +index 38a632b..5b2fc4b 100644 +--- a/libtwolame/bitbuffer.c ++++ b/libtwolame/bitbuffer.c +@@ -33,7 +33,7 @@ + + + /*create bit buffer*/ +-bit_stream *buffer_init(unsigned char *buffer, int buffer_size) ++bit_stream *bitbuffer_init(unsigned char *buffer, int buffer_size) + { + bit_stream *bs = (bit_stream *) TWOLAME_MALLOC(sizeof(bit_stream)); + +@@ -49,7 +49,7 @@ bit_stream *buffer_init(unsigned char *buffer, int buffer_size) + } + + /* Dellocate bit buffer */ +-void buffer_deinit(bit_stream ** bs) ++void bitbuffer_deinit(bit_stream ** bs) + { + + if (bs == NULL || *bs == NULL) +diff --git a/libtwolame/bitbuffer.h b/libtwolame/bitbuffer.h +index 0201347..f377c8f 100644 +--- a/libtwolame/bitbuffer.h ++++ b/libtwolame/bitbuffer.h +@@ -39,11 +39,11 @@ typedef struct bit_stream_struc { + } bit_stream; + + +-bit_stream *buffer_init(unsigned char *buffer, int buffer_size); +-void buffer_deinit(bit_stream ** bs); ++bit_stream *bitbuffer_init(unsigned char *buffer, int buffer_size); ++void bitbuffer_deinit(bit_stream ** bs); + + /*return the current bit stream length (in bits)*/ +-#define buffer_sstell(bs) (bs->totbit) ++#define bitbuffer_sstell(bs) (bs->totbit) + + #endif + +diff --git a/libtwolame/energy.c b/libtwolame/energy.c +index 219bd2c..312d8ae 100644 +--- a/libtwolame/energy.c ++++ b/libtwolame/energy.c +@@ -73,7 +73,7 @@ void do_energy_levels(twolame_options * glopts, bit_stream * bs) + unsigned char rhibyte, rlobyte, lhibyte, llobyte; + + // Get the position (in butes) of the end of the mpeg audio frame +- int frameEnd = buffer_sstell(bs) / 8; ++ int frameEnd = bitbuffer_sstell(bs) / 8; + + + // find the maximum in the left and right channels +diff --git a/libtwolame/twolame.c b/libtwolame/twolame.c +index fa4bcc0..d3b8450 100644 +--- a/libtwolame/twolame.c ++++ b/libtwolame/twolame.c +@@ -442,7 +442,7 @@ static int encode_frame(twolame_options * glopts, bit_stream * bs) + glopts->num_crc_bits = 0; + + // Store the number of bits initially in the bit buffer +- initial_bits = buffer_sstell(bs); ++ initial_bits = bitbuffer_sstell(bs); + + adb = available_bits(glopts); + +@@ -580,7 +580,7 @@ static int encode_frame(twolame_options * glopts, bit_stream * bs) + + + // Calulate the number of bits in this frame +- frameBits = buffer_sstell(bs) - initial_bits; ++ frameBits = bitbuffer_sstell(bs) - initial_bits; + if (frameBits % 8) { /* a program failure */ + fprintf(stderr, "Sent %ld bits = %ld slots plus %ld\n", frameBits, frameBits / 8, + frameBits % 8); +@@ -630,7 +630,7 @@ int twolame_encode_buffer(twolame_options * glopts, + + // now would be a great time to validate the size of the buffer. + // samples/1152 * sizeof(frame) < mp2buffer_size +- mybs = buffer_init(mp2buffer, mp2buffer_size); ++ mybs = bitbuffer_init(mp2buffer, mp2buffer_size); + + + // Use up all the samples in in_buffer +@@ -658,7 +658,7 @@ int twolame_encode_buffer(twolame_options * glopts, + if (glopts->samples_in_buffer >= TWOLAME_SAMPLES_PER_FRAME) { + int bytes = encode_frame(glopts, mybs); + if (bytes <= 0) { +- buffer_deinit(&mybs); ++ bitbuffer_deinit(&mybs); + return bytes; + } + mp2_size += bytes; +@@ -667,7 +667,7 @@ int twolame_encode_buffer(twolame_options * glopts, + } + + // free up the bit stream buffer structure +- buffer_deinit(&mybs); ++ bitbuffer_deinit(&mybs); + + return (mp2_size); + } +@@ -687,7 +687,7 @@ int twolame_encode_buffer_interleaved(twolame_options * glopts, + + // now would be a great time to validate the size of the buffer. + // samples/1152 * sizeof(frame) < mp2buffer_size +- mybs = buffer_init(mp2buffer, mp2buffer_size); ++ mybs = bitbuffer_init(mp2buffer, mp2buffer_size); + + // Use up all the samples in in_buffer + while (num_samples) { +@@ -714,7 +714,7 @@ int twolame_encode_buffer_interleaved(twolame_options * glopts, + if (glopts->samples_in_buffer >= TWOLAME_SAMPLES_PER_FRAME) { + int bytes = encode_frame(glopts, mybs); + if (bytes <= 0) { +- buffer_deinit(&mybs); ++ bitbuffer_deinit(&mybs); + return bytes; + } + mp2_size += bytes; +@@ -723,7 +723,7 @@ int twolame_encode_buffer_interleaved(twolame_options * glopts, + } + + // free up the bit stream buffer structure +- buffer_deinit(&mybs); ++ bitbuffer_deinit(&mybs); + + + return (mp2_size); +@@ -771,7 +771,7 @@ int twolame_encode_buffer_float32(twolame_options * glopts, + + // now would be a great time to validate the size of the buffer. + // samples/1152 * sizeof(frame) < mp2buffer_size +- mybs = buffer_init(mp2buffer, mp2buffer_size); ++ mybs = bitbuffer_init(mp2buffer, mp2buffer_size); + + + // Use up all the samples in in_buffer +@@ -800,7 +800,7 @@ int twolame_encode_buffer_float32(twolame_options * glopts, + if (glopts->samples_in_buffer >= TWOLAME_SAMPLES_PER_FRAME) { + int bytes = encode_frame(glopts, mybs); + if (bytes <= 0) { +- buffer_deinit(&mybs); ++ bitbuffer_deinit(&mybs); + return bytes; + } + mp2_size += bytes; +@@ -809,7 +809,7 @@ int twolame_encode_buffer_float32(twolame_options * glopts, + } + + // free up the bit stream buffer structure +- buffer_deinit(&mybs); ++ bitbuffer_deinit(&mybs); + + return (mp2_size); + } +@@ -829,7 +829,7 @@ int twolame_encode_buffer_float32_interleaved(twolame_options * glopts, + + // now would be a great time to validate the size of the buffer. + // samples/1152 * sizeof(frame) < mp2buffer_size +- mybs = buffer_init(mp2buffer, mp2buffer_size); ++ mybs = bitbuffer_init(mp2buffer, mp2buffer_size); + + // Use up all the samples in in_buffer + while (num_samples) { +@@ -857,7 +857,7 @@ int twolame_encode_buffer_float32_interleaved(twolame_options * glopts, + if (glopts->samples_in_buffer >= TWOLAME_SAMPLES_PER_FRAME) { + int bytes = encode_frame(glopts, mybs); + if (bytes <= 0) { +- buffer_deinit(&mybs); ++ bitbuffer_deinit(&mybs); + return bytes; + } + mp2_size += bytes; +@@ -866,7 +866,7 @@ int twolame_encode_buffer_float32_interleaved(twolame_options * glopts, + } + + // free up the bit stream buffer structure +- buffer_deinit(&mybs); ++ bitbuffer_deinit(&mybs); + + + return (mp2_size); +@@ -885,7 +885,7 @@ int twolame_encode_flush(twolame_options * glopts, unsigned char *mp2buffer, int + return 0; + } + // Create bit stream structure +- mybs = buffer_init(mp2buffer, mp2buffer_size); ++ mybs = bitbuffer_init(mp2buffer, mp2buffer_size); + + // Pad out the PCM buffers with 0 and encode the frame + for (i = glopts->samples_in_buffer; i < TWOLAME_SAMPLES_PER_FRAME; i++) { +@@ -897,7 +897,7 @@ int twolame_encode_flush(twolame_options * glopts, unsigned char *mp2buffer, int + glopts->samples_in_buffer = 0; + + // free up the bit stream buffer structure +- buffer_deinit(&mybs); ++ bitbuffer_deinit(&mybs); + + return mp2_size; + } +-- +2.17.1 + diff --git a/bsp/buildroot/package/uclibc/0004-mkostemp64-clear-flags-as-mkostemp-does.patch b/bsp/buildroot/package/uclibc/0004-mkostemp64-clear-flags-as-mkostemp-does.patch new file mode 100644 index 00000000..f87abd88 --- /dev/null +++ b/bsp/buildroot/package/uclibc/0004-mkostemp64-clear-flags-as-mkostemp-does.patch @@ -0,0 +1,38 @@ +From 09a776103e4aa75f95c9ad44554a9c2b56de3535 Mon Sep 17 00:00:00 2001 +From: Carlos Santos +Date: Mon, 29 Oct 2018 01:17:38 -0300 +Subject: [PATCH] mkostemp64: clear flags, as mkostemp does + +This should have been made in commit 9649721950 but was forgotten. + +Signed-off-by: Carlos Santos +--- + libc/stdlib/mkostemp64.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/libc/stdlib/mkostemp64.c b/libc/stdlib/mkostemp64.c +index aa9736cd6..f4674bb0c 100644 +--- a/libc/stdlib/mkostemp64.c ++++ b/libc/stdlib/mkostemp64.c +@@ -15,9 +15,9 @@ + License along with the GNU C Library; if not, see + . */ + +-#include + #include + #include ++#include + #include "../misc/internals/tempname.h" + + /* Generate a unique temporary file name from TEMPLATE. +@@ -27,6 +27,7 @@ + int + mkostemp64 (char *template, int flags) + { ++ flags -= flags & O_ACCMODE; /* Remove O_RDONLY, O_WRONLY, and O_RDWR. */ + return __gen_tempname (template, __GT_BIGFILE, flags | O_LARGEFILE, 0, + S_IRUSR | S_IWUSR); + } +-- +2.14.5 + diff --git a/bsp/buildroot/package/uclibc/Config.in b/bsp/buildroot/package/uclibc/Config.in index 0e24b254..ce56f277 100644 --- a/bsp/buildroot/package/uclibc/Config.in +++ b/bsp/buildroot/package/uclibc/Config.in @@ -70,6 +70,7 @@ config BR2_PTHREAD_DEBUG config BR2_TOOLCHAIN_BUILDROOT_USE_SSP bool "Enable stack protection support" + depends on BR2_PACKAGE_HOST_BINUTILS_SUPPORTS_CFI select BR2_TOOLCHAIN_HAS_SSP help Enable stack smashing protection support using GCCs diff --git a/bsp/buildroot/package/usb_modeswitch/usb_modeswitch.mk b/bsp/buildroot/package/usb_modeswitch/usb_modeswitch.mk index 8dd712f2..719e4fe3 100644 --- a/bsp/buildroot/package/usb_modeswitch/usb_modeswitch.mk +++ b/bsp/buildroot/package/usb_modeswitch/usb_modeswitch.mk @@ -10,6 +10,8 @@ USB_MODESWITCH_SITE = http://www.draisberghof.de/usb_modeswitch USB_MODESWITCH_DEPENDENCIES = libusb USB_MODESWITCH_LICENSE = GPL-2.0+ USB_MODESWITCH_LICENSE_FILES = COPYING +# Package does not build in parallel due to improper make rules +USB_MODESWITCH_MAKE = $(MAKE1) USB_MODESWITCH_BUILD_TARGETS = static USB_MODESWITCH_INSTALL_TARGETS = install-static diff --git a/bsp/buildroot/package/ustr/ustr.mk b/bsp/buildroot/package/ustr/ustr.mk index 8346adbc..c99ada52 100644 --- a/bsp/buildroot/package/ustr/ustr.mk +++ b/bsp/buildroot/package/ustr/ustr.mk @@ -28,5 +28,12 @@ USTR_MAKE_OPTS = all all-shared USTR_CONF_OPTS += LDCONFIG=/bin/true HOST_USTR_CONF_OPTS += LDCONFIG=/bin/true +# for some reason, ustr finds it useful to install its source code in +# /usr/share, which is totally useless on the target +define USTR_REMOVE_SOURCE_CODE + $(RM) -rf $(TARGET_DIR)/usr/share/ustr-$(USTR_VERSION) +endef +USTR_POST_INSTALL_TARGET_HOOKS += USTR_REMOVE_SOURCE_CODE + $(eval $(autotools-package)) $(eval $(host-autotools-package)) diff --git a/bsp/buildroot/package/vtun/Config.in b/bsp/buildroot/package/vtun/Config.in index bb8919c3..d63e7c76 100644 --- a/bsp/buildroot/package/vtun/Config.in +++ b/bsp/buildroot/package/vtun/Config.in @@ -10,7 +10,4 @@ config BR2_PACKAGE_VTUN It supports IP, PPP, SLIP, Ethernet and other tunnel types. - NOTE: It uses start-stop-daemon in init script, so be sure - to enable that within busybox - http://vtun.sourceforge.net/ diff --git a/bsp/buildroot/package/webkitgtk/0001-ARM-Building-FELightingNEON.cpp-fails-due-to-missing.patch b/bsp/buildroot/package/webkitgtk/0001-ARM-Building-FELightingNEON.cpp-fails-due-to-missing.patch deleted file mode 100644 index 6fb309d9..00000000 --- a/bsp/buildroot/package/webkitgtk/0001-ARM-Building-FELightingNEON.cpp-fails-due-to-missing.patch +++ /dev/null @@ -1,41 +0,0 @@ -From b252c7aed3fa6f22db8a26c3ab0bfe66e3490eef Mon Sep 17 00:00:00 2001 -From: Adrian Perez de Castro -Date: Sun, 23 Sep 2018 02:34:26 +0300 -Subject: [PATCH xserver] [ARM] Building FELightingNEON.cpp fails due to - missing lightVector member https://bugs.webkit.org/show_bug.cgi?id=189890 - -Reviewed by NOBODY (OOPS!). - -No new tests needed. - -* platform/graphics/cpu/arm/filters/FELightingNEON.h: -(WebCore::FELighting::platformApplyNeon): Adapt to new layout of "struct PaintingData" after r225122. ---- - Source/WebCore/ChangeLog | 12 ++++++++++++ - .../graphics/cpu/arm/filters/FELightingNEON.h | 6 +++--- - 2 files changed, 15 insertions(+), 3 deletions(-) - -Fetch from: https://bugs.webkit.org/show_bug.cgi?id=189890 -Upstream-Status: Pending -Signed-off-by: Adrian Perez de Castro - -diff --git a/Source/WebCore/platform/graphics/cpu/arm/filters/FELightingNEON.h b/Source/WebCore/platform/graphics/cpu/arm/filters/FELightingNEON.h -index 42af922374b..b542a4c81aa 100644 ---- a/Source/WebCore/platform/graphics/cpu/arm/filters/FELightingNEON.h -+++ b/Source/WebCore/platform/graphics/cpu/arm/filters/FELightingNEON.h -@@ -144,9 +144,9 @@ inline void FELighting::platformApplyNeon(const LightingData& data, const LightS - neonData.flags |= FLAG_CONE_EXPONENT_IS_1; - } else { - ASSERT(m_lightSource->type() == LS_DISTANT); -- floatArguments.lightX = paintingData.lightVector.x(); -- floatArguments.lightY = paintingData.lightVector.y(); -- floatArguments.lightZ = paintingData.lightVector.z(); -+ floatArguments.lightX = paintingData.initialLightingData.lightVector.x(); -+ floatArguments.lightY = paintingData.initialLightingData.lightVector.y(); -+ floatArguments.lightZ = paintingData.initialLightingData.lightVector.z(); - floatArguments.padding2 = 1; - } - --- -2.19.0 - diff --git a/bsp/buildroot/package/webkitgtk/Config.in b/bsp/buildroot/package/webkitgtk/Config.in index 96a7ab0c..260fa15b 100644 --- a/bsp/buildroot/package/webkitgtk/Config.in +++ b/bsp/buildroot/package/webkitgtk/Config.in @@ -88,6 +88,21 @@ config BR2_PACKAGE_WEBKITGTK_MULTIMEDIA This option pulls in all of the required dependencies to enable multimedia (video/audio) support. +if BR2_PACKAGE_WEBKITGTK_MULTIMEDIA + +config BR2_PACKAGE_WEBKITGTK_USE_GSTREAMER_GL + bool "use gstreamer-gl" + default y + depends on BR2_PACKAGE_GST1_PLUGINS_BASE_HAS_LIB_OPENGL + select BR2_PACKAGE_GST1_PLUGINS_BAD_PLUGIN_GL + help + Use the GStreamer GL elements for handling video content. + This is recommended as it improves performance of video + playback. In some target configurations incorrect rendering + might be produced, and disabling this option may help. + +endif + config BR2_PACKAGE_WEBKITGTK_WEBDRIVER bool "WebDriver support" help diff --git a/bsp/buildroot/package/webkitgtk/webkitgtk.hash b/bsp/buildroot/package/webkitgtk/webkitgtk.hash index 0b9b94ca..15b1b566 100644 --- a/bsp/buildroot/package/webkitgtk/webkitgtk.hash +++ b/bsp/buildroot/package/webkitgtk/webkitgtk.hash @@ -1,7 +1,7 @@ -# From https://webkitgtk.org/releases/webkitgtk-2.22.2.tar.xz.sums -md5 207d50d313c07b03726f3a7f22643934 webkitgtk-2.22.2.tar.xz -sha1 ff0c40e81e240aa0743f7e6483f175defebd1417 webkitgtk-2.22.2.tar.xz -sha256 345487d4d1896e711683f951d1e09387d3b90d7cf59295c0e634af7f515e99ba webkitgtk-2.22.2.tar.xz +# From https://webkitgtk.org/releases/webkitgtk-2.22.4.tar.xz.sums +md5 9f08d09cfc21c761a431a545549f301a webkitgtk-2.22.4.tar.xz +sha1 adf857c8a8b8fb79ba9b01bbe4b454956e633952 webkitgtk-2.22.4.tar.xz +sha256 fab5be2883802352ae0e735dd1eff4bc18abaff7ac78689cec72eb2f611943b8 webkitgtk-2.22.4.tar.xz # Hashes for license files: sha256 0b5d3a7cc325942567373b0ecd757d07c132e0ebd7c97bfc63f7e1a76094edb4 Source/WebCore/LICENSE-APPLE diff --git a/bsp/buildroot/package/webkitgtk/webkitgtk.mk b/bsp/buildroot/package/webkitgtk/webkitgtk.mk index f28417ac..cade28f9 100644 --- a/bsp/buildroot/package/webkitgtk/webkitgtk.mk +++ b/bsp/buildroot/package/webkitgtk/webkitgtk.mk @@ -4,7 +4,7 @@ # ################################################################################ -WEBKITGTK_VERSION = 2.22.2 +WEBKITGTK_VERSION = 2.22.4 WEBKITGTK_SITE = http://www.webkitgtk.org/releases WEBKITGTK_SOURCE = webkitgtk-$(WEBKITGTK_VERSION).tar.xz WEBKITGTK_INSTALL_STAGING = YES @@ -22,10 +22,10 @@ WEBKITGTK_CONF_OPTS = \ -DENABLE_INTROSPECTION=OFF \ -DENABLE_MINIBROWSER=ON \ -DENABLE_SPELLCHECK=ON \ - -DENABLE_WOFF2=ON \ -DPORT=GTK \ -DUSE_LIBNOTIFY=OFF \ - -DUSE_LIBHYPHEN=OFF + -DUSE_LIBHYPHEN=OFF \ + -DUSE_WOFF2=ON # ARM needs NEON for JIT # i386 & x86_64 don't seem to have any special requirements @@ -97,4 +97,11 @@ WEBKITGTK_CONF_OPTS += -DENABLE_WAYLAND_TARGET=ON endif endif +ifeq ($(BR2_PACKAGE_WEBKITGTK_USE_GSTREAMER_GL),y) +WEBKITGTK_CONF_OPTS += -DUSE_GSTREAMER_GL=ON +WEBKITGTK_DEPENDENCIES += gst1-plugins-bad +else +WEBKITGTK_CONF_OPTS += -DUSE_GSTREAMER_GL=OFF +endif + $(eval $(cmake-package)) diff --git a/bsp/buildroot/package/wireshark/wireshark.hash b/bsp/buildroot/package/wireshark/wireshark.hash index 30b00b4d..8b2d7bc9 100644 --- a/bsp/buildroot/package/wireshark/wireshark.hash +++ b/bsp/buildroot/package/wireshark/wireshark.hash @@ -1,4 +1,4 @@ -# From: https://www.wireshark.org/download/src/all-versions/SIGNATURES-2.2.16.txt -sha256 7dcc4e9f29ad8dd75849aa3b6f70b6ec82ab6899cb168096572775a6d97ced8a wireshark-2.2.16.tar.bz2 +# From: https://www.wireshark.org/download/src/all-versions/SIGNATURES-2.2.17.txt +sha256 923d39ff9c6df83b9594868542061da33bf330e12526778a8cb3adcf912eebb0 wireshark-2.2.17.tar.bz2 # Locally calculated sha256 7cdbed2b697efaa45576a033f1ac0e73cd045644a91c79bbf41d4a7d81dac7bf COPYING diff --git a/bsp/buildroot/package/wireshark/wireshark.mk b/bsp/buildroot/package/wireshark/wireshark.mk index 3d729ae0..fb90f2b9 100644 --- a/bsp/buildroot/package/wireshark/wireshark.mk +++ b/bsp/buildroot/package/wireshark/wireshark.mk @@ -4,7 +4,7 @@ # ################################################################################ -WIRESHARK_VERSION = 2.2.16 +WIRESHARK_VERSION = 2.2.17 WIRESHARK_SOURCE = wireshark-$(WIRESHARK_VERSION).tar.bz2 WIRESHARK_SITE = https://www.wireshark.org/download/src/all-versions WIRESHARK_LICENSE = wireshark license diff --git a/bsp/buildroot/package/x11r7/xdriver_xf86-video-geode/0001-Remove-call-to-LoaderGetOS.patch b/bsp/buildroot/package/x11r7/xdriver_xf86-video-geode/0001-Remove-call-to-LoaderGetOS.patch new file mode 100644 index 00000000..18e4a60d --- /dev/null +++ b/bsp/buildroot/package/x11r7/xdriver_xf86-video-geode/0001-Remove-call-to-LoaderGetOS.patch @@ -0,0 +1,53 @@ +From 09aaa3d1fae4aeb099b16e7a046151761bcdea95 Mon Sep 17 00:00:00 2001 +From: Adam Jackson +Date: Tue, 24 Jan 2017 09:53:06 -0500 +Subject: Remove call to LoaderGetOS + +On OSes that don't have a /dev/videox we'll just fail the open() and not +initialize the Xv adaptor. + +Signed-off-by: Adam Jackson + +Downloaded from upstream commit +https://cgit.freedesktop.org/xorg/driver/xf86-video-geode/commit/?id=09aaa3d1fae4aeb099b16e7a046151761bcdea95 + +Signed-off-by: Bernd Kuhls +--- + src/z4l.c | 13 ------------- + 1 file changed, 13 deletions(-) + +diff --git a/src/z4l.c b/src/z4l.c +index eccefe8..be0d345 100644 +--- a/src/z4l.c ++++ b/src/z4l.c +@@ -1709,7 +1709,6 @@ _X_EXPORT XF86ModuleData ztvModuleData = { &z4lVersionRec, z4lSetup, NULL }; + static pointer + z4lSetup(pointer module, pointer opts, int *errmaj, int *errmin) + { +- const char *osname; + static Bool setupDone = FALSE; + + if (setupDone != FALSE) { +@@ -1719,19 +1718,7 @@ z4lSetup(pointer module, pointer opts, int *errmaj, int *errmin) + } + + setupDone = TRUE; +- LoaderGetOS(&osname, NULL, NULL, NULL); +- +- if (osname == NULL || strcmp(osname, "linux") != 0) { +- if (errmaj) +- *errmaj = LDR_BADOS; +- if (errmin) +- *errmin = 0; +- +- return NULL; +- } +- + xf86AddDriver(&Z4l, module, 0); +- + return (pointer) 1; + } + +-- +cgit v1.1 + diff --git a/bsp/buildroot/package/x11r7/xdriver_xf86-video-geode/0002-gx-Fix-RANDR-initialization-for-xserver-1.20.patch b/bsp/buildroot/package/x11r7/xdriver_xf86-video-geode/0002-gx-Fix-RANDR-initialization-for-xserver-1.20.patch new file mode 100644 index 00000000..37e4a25e --- /dev/null +++ b/bsp/buildroot/package/x11r7/xdriver_xf86-video-geode/0002-gx-Fix-RANDR-initialization-for-xserver-1.20.patch @@ -0,0 +1,35 @@ +From 8382e6bb0c76a8029493eae3f2d7a3dbfd0cfc12 Mon Sep 17 00:00:00 2001 +From: Adam Jackson +Date: Mon, 5 Mar 2018 10:28:15 -0500 +Subject: gx: Fix RANDR initialization for xserver 1.20 + +xf86DisableRandR() doesn't exist anymore, and we don't need it anyway, +the core code will notice that we set up RANDR ourselves. + +Signed-off-by: Adam Jackson + +Downloaded from upstream commit +https://cgit.freedesktop.org/xorg/driver/xf86-video-geode/commit/?id=8382e6bb0c76a8029493eae3f2d7a3dbfd0cfc12 + +Signed-off-by: Bernd Kuhls +--- + src/gx_driver.c | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/src/gx_driver.c b/src/gx_driver.c +index ab57df1..4de336e 100644 +--- a/src/gx_driver.c ++++ b/src/gx_driver.c +@@ -1426,7 +1426,9 @@ GXScreenInit(SCREEN_INIT_ARGS_DECL) + + /* Set up RandR */ + ++#if GET_ABI_MAJOR(ABI_VIDEODRV_VERSION) < 24 + xf86DisableRandR(); /* We provide our own RandR goodness */ ++#endif + + /* Try to set up the shadow FB for rotation */ + +-- +cgit v1.1 + diff --git a/bsp/buildroot/package/x11r7/xlib_libfontenc/xlib_libfontenc.mk b/bsp/buildroot/package/x11r7/xlib_libfontenc/xlib_libfontenc.mk index e2c4c6e8..63e32168 100644 --- a/bsp/buildroot/package/x11r7/xlib_libfontenc/xlib_libfontenc.mk +++ b/bsp/buildroot/package/x11r7/xlib_libfontenc/xlib_libfontenc.mk @@ -10,8 +10,8 @@ XLIB_LIBFONTENC_SITE = http://xorg.freedesktop.org/releases/individual/lib XLIB_LIBFONTENC_LICENSE = MIT XLIB_LIBFONTENC_LICENSE_FILES = COPYING XLIB_LIBFONTENC_INSTALL_STAGING = YES -XLIB_LIBFONTENC_DEPENDENCIES = zlib xproto_xproto -HOST_XLIB_LIBFONTENC_DEPENDENCIES = host-zlib host-xproto_xproto +XLIB_LIBFONTENC_DEPENDENCIES = zlib xproto_xproto host-pkgconf +HOST_XLIB_LIBFONTENC_DEPENDENCIES = host-zlib host-xproto_xproto host-pkgconf $(eval $(autotools-package)) $(eval $(host-autotools-package)) diff --git a/bsp/buildroot/package/x11r7/xproto_inputproto/xproto_inputproto.mk b/bsp/buildroot/package/x11r7/xproto_inputproto/xproto_inputproto.mk index 20169b5c..9e45e2d3 100644 --- a/bsp/buildroot/package/x11r7/xproto_inputproto/xproto_inputproto.mk +++ b/bsp/buildroot/package/x11r7/xproto_inputproto/xproto_inputproto.mk @@ -11,6 +11,8 @@ XPROTO_INPUTPROTO_LICENSE = MIT XPROTO_INPUTPROTO_LICENSE_FILES = COPYING XPROTO_INPUTPROTO_INSTALL_STAGING = YES XPROTO_INPUTPROTO_INSTALL_TARGET = NO +XPROTO_INPUTPROTO_CONF_ENV = ac_cv_path_ASCIIDOC="" +HOST_XPROTO_INPUTPROTO_CONF_ENV = ac_cv_path_ASCIIDOC="" $(eval $(autotools-package)) $(eval $(host-autotools-package)) diff --git a/bsp/buildroot/package/x11r7/xserver_xorg-server/1.19.6/0005-Disable-logfile-and-modulepath-when-running-with-ele.patch b/bsp/buildroot/package/x11r7/xserver_xorg-server/1.19.6/0005-Disable-logfile-and-modulepath-when-running-with-ele.patch new file mode 100644 index 00000000..ba0f09cd --- /dev/null +++ b/bsp/buildroot/package/x11r7/xserver_xorg-server/1.19.6/0005-Disable-logfile-and-modulepath-when-running-with-ele.patch @@ -0,0 +1,52 @@ +From 0ff8977a348c316cd9909b890c48d7f5175a5eba Mon Sep 17 00:00:00 2001 +From: Matthieu Herrb +Date: Tue, 23 Oct 2018 21:29:08 +0200 +Subject: [PATCH] Disable -logfile and -modulepath when running with elevated + privileges + +Could cause privilege elevation and/or arbitrary files overwrite, when +the X server is running with elevated privileges (ie when Xorg is +installed with the setuid bit set and started by a non-root user). + +CVE-2018-14665 + +Issue reported by Narendra Shinde and Red Hat. + +Signed-off-by: Matthieu Herrb +Reviewed-by: Alan Coopersmith +Reviewed-by: Peter Hutterer +Reviewed-by: Adam Jackson +(cherry picked from commit 50c0cf885a6e91c0ea71fb49fa8f1b7c86fe330e) +Signed-off-by: Peter Korsgaard +--- + hw/xfree86/common/xf86Init.c | 8 ++++++-- + 1 file changed, 6 insertions(+), 2 deletions(-) + +diff --git a/hw/xfree86/common/xf86Init.c b/hw/xfree86/common/xf86Init.c +index d59c224d5..183158c21 100644 +--- a/hw/xfree86/common/xf86Init.c ++++ b/hw/xfree86/common/xf86Init.c +@@ -1135,14 +1135,18 @@ ddxProcessArgument(int argc, char **argv, int i) + /* First the options that are not allowed with elevated privileges */ + if (!strcmp(argv[i], "-modulepath")) { + CHECK_FOR_REQUIRED_ARGUMENT(); +- xf86CheckPrivs(argv[i], argv[i + 1]); ++ if (xf86PrivsElevated()) ++ FatalError("\nInvalid argument -modulepath " ++ "with elevated privileges\n"); + xf86ModulePath = argv[i + 1]; + xf86ModPathFrom = X_CMDLINE; + return 2; + } + if (!strcmp(argv[i], "-logfile")) { + CHECK_FOR_REQUIRED_ARGUMENT(); +- xf86CheckPrivs(argv[i], argv[i + 1]); ++ if (xf86PrivsElevated()) ++ FatalError("\nInvalid argument -logfile " ++ "with elevated privileges\n"); + xf86LogFile = argv[i + 1]; + xf86LogFileFrom = X_CMDLINE; + return 2; +-- +2.11.0 + diff --git a/bsp/buildroot/support/scripts/graph-depends b/bsp/buildroot/support/scripts/graph-depends index 85c9bf0a..51b69c44 100755 --- a/bsp/buildroot/support/scripts/graph-depends +++ b/bsp/buildroot/support/scripts/graph-depends @@ -183,9 +183,10 @@ def get_all_depends(pkgs): # The Graphviz "dot" utility doesn't like dashes in node names. So for -# node names, we strip all dashes. +# node names, we strip all dashes. Also, nodes can't start with a number, +# so we prepend an underscore. def pkg_node_name(pkg): - return pkg.replace("-", "") + return "_" + pkg.replace("-", "") TARGET_EXCEPTIONS = [ diff --git a/bsp/buildroot/support/scripts/mkmakefile b/bsp/buildroot/support/scripts/mkmakefile index 37162a31..c7569f2c 100755 --- a/bsp/buildroot/support/scripts/mkmakefile +++ b/bsp/buildroot/support/scripts/mkmakefile @@ -20,6 +20,13 @@ echo " GEN $2/Makefile" cat << EOF > $2/Makefile # Automatically generated by $0: don't edit +ifeq ("\$(origin V)", "command line") +VERBOSE := \$(V) +endif +ifneq (\$(VERBOSE),1) +Q := @ +endif + lastword = \$(word \$(words \$(1)),\$(1)) makedir := \$(dir \$(call lastword,\$(MAKEFILE_LIST))) @@ -33,7 +40,7 @@ MAKEFLAGS += --no-print-directory all := \$(filter-out Makefile,\$(MAKECMDGOALS)) _all: - umask 0022 && \$(MAKE) \$(MAKEARGS) \$(all) + \$(Q)umask 0022 && \$(MAKE) \$(MAKEARGS) \$(all) Makefile:; diff --git a/bsp/buildroot/utils/brmake b/bsp/buildroot/utils/brmake new file mode 100755 index 00000000..e30119dd --- /dev/null +++ b/bsp/buildroot/utils/brmake @@ -0,0 +1,42 @@ +#!/bin/bash +# (C) 2016, "Yann E. MORIN" +# License: WTFPL, https://spdx.org/licenses/WTFPL.html + +main() { + local found ret start d h m mf + + if ! which unbuffer >/dev/null 2>&1; then + printf "you need to install 'unbuffer' (from package expect or expect-dev)\n" >&2 + exit 1 + fi + + start=${SECONDS} + + ( exec 2>&1; unbuffer make "${@}"; ) \ + > >( while read line; do + printf "%(%Y-%m-%dT%H:%M:%S)T %s\n" -1 "${line}" + done \ + |tee -a br.log \ + |grep --colour=never -E '>>>' + ) + ret=${?} + + d=$((SECONDS-start)) + printf "Done in " + h=$((d/3600)) + d=$((d%3600)) + [ ${h} -eq 0 ] || { printf "%dh " ${h}; mf="02"; } + m=$((d/60)) + d=$((d%60)) + [ ${m} -eq 0 ] || { printf "%${mf}dmin " ${m}; sf="02"; } + printf "%${sf}ds" ${d} + + if [ ${ret} -ne 0 ]; then + printf " (error code: %s)" ${ret} + fi + printf "\n" + + return ${ret} +} + +main "${@}" diff --git a/bsp/buildroot/utils/check-package b/bsp/buildroot/utils/check-package new file mode 100755 index 00000000..a87a74de --- /dev/null +++ b/bsp/buildroot/utils/check-package @@ -0,0 +1,144 @@ +#!/usr/bin/env python +# See utils/checkpackagelib/readme.txt before editing this file. + +from __future__ import print_function +import argparse +import inspect +import re +import sys + +import checkpackagelib.lib_config +import checkpackagelib.lib_hash +import checkpackagelib.lib_mk +import checkpackagelib.lib_patch + +VERBOSE_LEVEL_TO_SHOW_IGNORED_FILES = 3 +flags = None # Command line arguments. + + +def parse_args(): + parser = argparse.ArgumentParser() + + # Do not use argparse.FileType("r") here because only files with known + # format will be open based on the filename. + parser.add_argument("files", metavar="F", type=str, nargs="*", + help="list of files") + + parser.add_argument("--manual-url", action="store", + default="http://nightly.buildroot.org/", + help="default: %(default)s") + parser.add_argument("--verbose", "-v", action="count", default=0) + + # Now the debug options in the order they are processed. + parser.add_argument("--include-only", dest="include_list", action="append", + help="run only the specified functions (debug)") + parser.add_argument("--exclude", dest="exclude_list", action="append", + help="do not run the specified functions (debug)") + parser.add_argument("--dry-run", action="store_true", help="print the " + "functions that would be called for each file (debug)") + + return parser.parse_args() + + +CONFIG_IN_FILENAME = re.compile("/Config\.\S*$") +FILE_IS_FROM_A_PACKAGE = re.compile("package/[^/]*/") + + +def get_lib_from_filename(fname): + if FILE_IS_FROM_A_PACKAGE.search(fname) is None: + return None + if CONFIG_IN_FILENAME.search(fname): + return checkpackagelib.lib_config + if fname.endswith(".hash"): + return checkpackagelib.lib_hash + if fname.endswith(".mk"): + return checkpackagelib.lib_mk + if fname.endswith(".patch"): + return checkpackagelib.lib_patch + return None + + +def is_a_check_function(m): + if not inspect.isclass(m): + return False + # do not call the base class + if m.__name__.startswith("_"): + return False + if flags.include_list and m.__name__ not in flags.include_list: + return False + if flags.exclude_list and m.__name__ in flags.exclude_list: + return False + return True + + +def print_warnings(warnings): + # Avoid the need to use 'return []' at the end of every check function. + if warnings is None: + return 0 # No warning generated. + + for level, message in enumerate(warnings): + if flags.verbose >= level: + print(message.replace("\t", "< tab >").rstrip()) + return 1 # One more warning to count. + + +def check_file_using_lib(fname): + # Count number of warnings generated and lines processed. + nwarnings = 0 + nlines = 0 + + lib = get_lib_from_filename(fname) + if not lib: + if flags.verbose >= VERBOSE_LEVEL_TO_SHOW_IGNORED_FILES: + print("{}: ignored".format(fname)) + return nwarnings, nlines + classes = inspect.getmembers(lib, is_a_check_function) + + if flags.dry_run: + functions_to_run = [c[0] for c in classes] + print("{}: would run: {}".format(fname, functions_to_run)) + return nwarnings, nlines + + objects = [c[1](fname, flags.manual_url) for c in classes] + + for cf in objects: + nwarnings += print_warnings(cf.before()) + for lineno, text in enumerate(open(fname, "r").readlines()): + nlines += 1 + for cf in objects: + nwarnings += print_warnings(cf.check_line(lineno + 1, text)) + for cf in objects: + nwarnings += print_warnings(cf.after()) + + return nwarnings, nlines + + +def __main__(): + global flags + flags = parse_args() + + if len(flags.files) == 0: + print("No files to check style") + sys.exit(1) + + # Accumulate number of warnings generated and lines processed. + total_warnings = 0 + total_lines = 0 + + for fname in flags.files: + nwarnings, nlines = check_file_using_lib(fname) + total_warnings += nwarnings + total_lines += nlines + + # The warning messages are printed to stdout and can be post-processed + # (e.g. counted by 'wc'), so for stats use stderr. Wait all warnings are + # printed, for the case there are many of them, before printing stats. + sys.stdout.flush() + print("{} lines processed".format(total_lines), file=sys.stderr) + print("{} warnings generated".format(total_warnings), file=sys.stderr) + + if total_warnings > 0: + sys.exit(1) + + +__main__() diff --git a/bsp/buildroot/utils/checkpackagelib/__init__.py b/bsp/buildroot/utils/checkpackagelib/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/bsp/buildroot/utils/checkpackagelib/base.py b/bsp/buildroot/utils/checkpackagelib/base.py new file mode 100644 index 00000000..fc09bec9 --- /dev/null +++ b/bsp/buildroot/utils/checkpackagelib/base.py @@ -0,0 +1,16 @@ +# See utils/checkpackagelib/readme.txt before editing this file. + + +class _CheckFunction(object): + def __init__(self, filename, url_to_manual): + self.filename = filename + self.url_to_manual = url_to_manual + + def before(self): + pass + + def check_line(self, lineno, text): + pass + + def after(self): + pass diff --git a/bsp/buildroot/utils/checkpackagelib/lib.py b/bsp/buildroot/utils/checkpackagelib/lib.py new file mode 100644 index 00000000..91f4ad49 --- /dev/null +++ b/bsp/buildroot/utils/checkpackagelib/lib.py @@ -0,0 +1,54 @@ +# See utils/checkpackagelib/readme.txt before editing this file. + +from base import _CheckFunction + + +class ConsecutiveEmptyLines(_CheckFunction): + def before(self): + self.lastline = "non empty" + + def check_line(self, lineno, text): + if text.strip() == "" == self.lastline.strip(): + return ["{}:{}: consecutive empty lines" + .format(self.filename, lineno)] + self.lastline = text + + +class EmptyLastLine(_CheckFunction): + def before(self): + self.lastlineno = 0 + self.lastline = "non empty" + + def check_line(self, lineno, text): + self.lastlineno = lineno + self.lastline = text + + def after(self): + if self.lastline.strip() == "": + return ["{}:{}: empty line at end of file" + .format(self.filename, self.lastlineno)] + + +class NewlineAtEof(_CheckFunction): + def before(self): + self.lastlineno = 0 + self.lastline = "\n" + + def check_line(self, lineno, text): + self.lastlineno = lineno + self.lastline = text + + def after(self): + if self.lastline == self.lastline.rstrip("\r\n"): + return ["{}:{}: missing newline at end of file" + .format(self.filename, self.lastlineno), + self.lastline] + + +class TrailingSpace(_CheckFunction): + def check_line(self, lineno, text): + line = text.rstrip("\r\n") + if line != line.rstrip(): + return ["{}:{}: line contains trailing whitespace" + .format(self.filename, lineno), + text] diff --git a/bsp/buildroot/utils/checkpackagelib/lib_config.py b/bsp/buildroot/utils/checkpackagelib/lib_config.py new file mode 100644 index 00000000..11d885f8 --- /dev/null +++ b/bsp/buildroot/utils/checkpackagelib/lib_config.py @@ -0,0 +1,137 @@ +# See utils/checkpackagelib/readme.txt before editing this file. +# Kconfig generates errors if someone introduces a typo like "boool" instead of +# "bool", so below check functions don't need to check for things already +# checked by running "make menuconfig". + +import re + +from base import _CheckFunction +from lib import ConsecutiveEmptyLines # noqa: F401 +from lib import EmptyLastLine # noqa: F401 +from lib import NewlineAtEof # noqa: F401 +from lib import TrailingSpace # noqa: F401 + + +def _empty_or_comment(text): + line = text.strip() + # ignore empty lines and comment lines indented or not + return line == "" or line.startswith("#") + + +def _part_of_help_text(text): + return text.startswith("\t ") + + +# used in more than one check +entries_that_should_not_be_indented = [ + "choice", "comment", "config", "endchoice", "endif", "endmenu", "if", + "menu", "menuconfig", "source"] + + +class AttributesOrder(_CheckFunction): + attributes_order_convention = { + "bool": 1, "prompt": 1, "string": 1, "default": 2, "depends": 3, + "select": 4, "help": 5} + + def before(self): + self.state = 0 + + def check_line(self, lineno, text): + if _empty_or_comment(text) or _part_of_help_text(text): + return + + attribute = text.split()[0] + + if attribute in entries_that_should_not_be_indented: + self.state = 0 + return + if attribute not in self.attributes_order_convention.keys(): + return + new_state = self.attributes_order_convention[attribute] + wrong_order = self.state > new_state + + # save to process next line + self.state = new_state + + if wrong_order: + return ["{}:{}: attributes order: type, default, depends on," + " select, help ({}#_config_files)" + .format(self.filename, lineno, self.url_to_manual), + text] + + +class HelpText(_CheckFunction): + HELP_TEXT_FORMAT = re.compile("^\t .{,62}$") + URL_ONLY = re.compile("^(http|https|git)://\S*$") + + def before(self): + self.help_text = False + + def check_line(self, lineno, text): + if _empty_or_comment(text): + return + + entry = text.split()[0] + + if entry in entries_that_should_not_be_indented: + self.help_text = False + return + if text.strip() == "help": + self.help_text = True + return + + if not self.help_text: + return + + if self.HELP_TEXT_FORMAT.match(text.rstrip()): + return + if self.URL_ONLY.match(text.strip()): + return + return ["{}:{}: help text: <2 spaces><62 chars>" + " ({}#writing-rules-config-in)" + .format(self.filename, lineno, self.url_to_manual), + text, + "\t " + "123456789 " * 6 + "12"] + + +class Indent(_CheckFunction): + ENDS_WITH_BACKSLASH = re.compile(r"^[^#].*\\$") + entries_that_should_be_indented = [ + "bool", "default", "depends", "help", "prompt", "select", "string"] + + def before(self): + self.backslash = False + + def check_line(self, lineno, text): + if _empty_or_comment(text) or _part_of_help_text(text): + self.backslash = False + return + + entry = text.split()[0] + + last_line_ends_in_backslash = self.backslash + + # calculate for next line + if self.ENDS_WITH_BACKSLASH.search(text): + self.backslash = True + else: + self.backslash = False + + if last_line_ends_in_backslash: + if text.startswith("\t"): + return + return ["{}:{}: continuation line should be indented using tabs" + .format(self.filename, lineno), + text] + + if entry in self.entries_that_should_be_indented: + if not text.startswith("\t{}".format(entry)): + return ["{}:{}: should be indented with one tab" + " ({}#_config_files)" + .format(self.filename, lineno, self.url_to_manual), + text] + elif entry in entries_that_should_not_be_indented: + if not text.startswith(entry): + return ["{}:{}: should not be indented" + .format(self.filename, lineno), + text] diff --git a/bsp/buildroot/utils/checkpackagelib/lib_hash.py b/bsp/buildroot/utils/checkpackagelib/lib_hash.py new file mode 100644 index 00000000..6d4cc9fd --- /dev/null +++ b/bsp/buildroot/utils/checkpackagelib/lib_hash.py @@ -0,0 +1,55 @@ +# See utils/checkpackagelib/readme.txt before editing this file. +# The validity of the hashes itself is checked when building, so below check +# functions don't need to check for things already checked by running +# "make package-dirclean package-source". + +import re + +from base import _CheckFunction +from lib import ConsecutiveEmptyLines # noqa: F401 +from lib import EmptyLastLine # noqa: F401 +from lib import NewlineAtEof # noqa: F401 +from lib import TrailingSpace # noqa: F401 + + +def _empty_line_or_comment(text): + return text.strip() == "" or text.startswith("#") + + +class HashNumberOfFields(_CheckFunction): + def check_line(self, lineno, text): + if _empty_line_or_comment(text): + return + + fields = text.split() + if len(fields) != 3: + return ["{}:{}: expected three fields ({}#adding-packages-hash)" + .format(self.filename, lineno, self.url_to_manual), + text] + + +class HashType(_CheckFunction): + len_of_hash = {"md5": 32, "sha1": 40, "sha224": 56, "sha256": 64, + "sha384": 96, "sha512": 128} + + def check_line(self, lineno, text): + if _empty_line_or_comment(text): + return + + fields = text.split() + if len(fields) < 2: + return + + htype, hexa = fields[:2] + if htype == "none": + return + if htype not in self.len_of_hash.keys(): + return ["{}:{}: unexpected type of hash ({}#adding-packages-hash)" + .format(self.filename, lineno, self.url_to_manual), + text] + if not re.match("^[0-9A-Fa-f]{%s}$" % self.len_of_hash[htype], hexa): + return ["{}:{}: hash size does not match type " + "({}#adding-packages-hash)" + .format(self.filename, lineno, self.url_to_manual), + text, + "expected {} hex digits".format(self.len_of_hash[htype])] diff --git a/bsp/buildroot/utils/checkpackagelib/lib_mk.py b/bsp/buildroot/utils/checkpackagelib/lib_mk.py new file mode 100644 index 00000000..2df2e1a8 --- /dev/null +++ b/bsp/buildroot/utils/checkpackagelib/lib_mk.py @@ -0,0 +1,246 @@ +# See utils/checkpackagelib/readme.txt before editing this file. +# There are already dependency checks during the build, so below check +# functions don't need to check for things already checked by exploring the +# menu options using "make menuconfig" and by running "make" with appropriate +# packages enabled. + +import re + +from base import _CheckFunction +from lib import ConsecutiveEmptyLines # noqa: F401 +from lib import EmptyLastLine # noqa: F401 +from lib import NewlineAtEof # noqa: F401 +from lib import TrailingSpace # noqa: F401 + + +class Indent(_CheckFunction): + COMMENT = re.compile("^\s*#") + CONDITIONAL = re.compile("^\s*(ifeq|ifneq|endif)\s") + ENDS_WITH_BACKSLASH = re.compile(r"^[^#].*\\$") + END_DEFINE = re.compile("^\s*endef\s") + MAKEFILE_TARGET = re.compile("^[^# \t]+:\s") + START_DEFINE = re.compile("^\s*define\s") + + def before(self): + self.define = False + self.backslash = False + self.makefile_target = False + + def check_line(self, lineno, text): + if self.START_DEFINE.search(text): + self.define = True + return + if self.END_DEFINE.search(text): + self.define = False + return + + expect_tabs = False + if self.define or self.backslash or self.makefile_target: + expect_tabs = True + if self.CONDITIONAL.search(text): + expect_tabs = False + + # calculate for next line + if self.ENDS_WITH_BACKSLASH.search(text): + self.backslash = True + else: + self.backslash = False + + if self.MAKEFILE_TARGET.search(text): + self.makefile_target = True + return + if text.strip() == "": + self.makefile_target = False + return + + # comment can be indented or not inside define ... endef, so ignore it + if self.define and self.COMMENT.search(text): + return + + if expect_tabs: + if not text.startswith("\t"): + return ["{}:{}: expected indent with tabs" + .format(self.filename, lineno), + text] + else: + if text.startswith("\t"): + return ["{}:{}: unexpected indent with tabs" + .format(self.filename, lineno), + text] + + +class PackageHeader(_CheckFunction): + def before(self): + self.skip = False + + def check_line(self, lineno, text): + if self.skip or lineno > 6: + return + + if lineno in [1, 5]: + if lineno == 1 and text.startswith("include "): + self.skip = True + return + if text.rstrip() != "#" * 80: + return ["{}:{}: should be 80 hashes ({}#writing-rules-mk)" + .format(self.filename, lineno, self.url_to_manual), + text, + "#" * 80] + elif lineno in [2, 4]: + if text.rstrip() != "#": + return ["{}:{}: should be 1 hash ({}#writing-rules-mk)" + .format(self.filename, lineno, self.url_to_manual), + text] + elif lineno == 6: + if text.rstrip() != "": + return ["{}:{}: should be a blank line ({}#writing-rules-mk)" + .format(self.filename, lineno, self.url_to_manual), + text] + + +class RemoveDefaultPackageSourceVariable(_CheckFunction): + packages_that_may_contain_default_source = ["binutils", "gcc", "gdb"] + PACKAGE_NAME = re.compile("/([^/]+)\.mk") + + def before(self): + package = self.PACKAGE_NAME.search(self.filename).group(1) + package_upper = package.replace("-", "_").upper() + self.package = package + self.FIND_SOURCE = re.compile( + "^{}_SOURCE\s*=\s*{}-\$\({}_VERSION\)\.tar\.gz" + .format(package_upper, package, package_upper)) + + def check_line(self, lineno, text): + if self.FIND_SOURCE.search(text): + + if self.package in self.packages_that_may_contain_default_source: + return + + return ["{}:{}: remove default value of _SOURCE variable " + "({}#generic-package-reference)" + .format(self.filename, lineno, self.url_to_manual), + text] + + +class SpaceBeforeBackslash(_CheckFunction): + TAB_OR_MULTIPLE_SPACES_BEFORE_BACKSLASH = re.compile(r"^.*( |\t)\\$") + + def check_line(self, lineno, text): + if self.TAB_OR_MULTIPLE_SPACES_BEFORE_BACKSLASH.match(text.rstrip()): + return ["{}:{}: use only one space before backslash" + .format(self.filename, lineno), + text] + + +class TrailingBackslash(_CheckFunction): + ENDS_WITH_BACKSLASH = re.compile(r"^[^#].*\\$") + + def before(self): + self.backslash = False + + def check_line(self, lineno, text): + last_line_ends_in_backslash = self.backslash + + # calculate for next line + if self.ENDS_WITH_BACKSLASH.search(text): + self.backslash = True + self.lastline = text + return + self.backslash = False + + if last_line_ends_in_backslash and text.strip() == "": + return ["{}:{}: remove trailing backslash" + .format(self.filename, lineno - 1), + self.lastline] + + +class TypoInPackageVariable(_CheckFunction): + ALLOWED = re.compile("|".join([ + "ACLOCAL_DIR", + "ACLOCAL_HOST_DIR", + "BR_CCACHE_INITIAL_SETUP", + "BR_NO_CHECK_HASH_FOR", + "LINUX_POST_PATCH_HOOKS", + "LINUX_TOOLS", + "LUA_RUN", + "MKFS_JFFS2", + "MKIMAGE_ARCH", + "PKG_CONFIG_HOST_BINARY", + "TARGET_FINALIZE_HOOKS", + "XTENSA_CORE_NAME"])) + PACKAGE_NAME = re.compile("/([^/]+)\.mk") + VARIABLE = re.compile("^([A-Z0-9_]+_[A-Z0-9_]+)\s*(\+|)=") + + def before(self): + package = self.PACKAGE_NAME.search(self.filename).group(1) + package = package.replace("-", "_").upper() + # linux tools do not use LINUX_TOOL_ prefix for variables + package = package.replace("LINUX_TOOL_", "") + self.package = package + self.REGEX = re.compile("^(HOST_)?({}_[A-Z0-9_]+)".format(package)) + self.FIND_VIRTUAL = re.compile( + "^{}_PROVIDES\s*(\+|)=\s*(.*)".format(package)) + self.virtual = [] + + def check_line(self, lineno, text): + m = self.VARIABLE.search(text) + if m is None: + return + + variable = m.group(1) + + # allow to set variables for virtual package this package provides + v = self.FIND_VIRTUAL.search(text) + if v: + self.virtual += v.group(2).upper().split() + return + for virtual in self.virtual: + if variable.startswith("{}_".format(virtual)): + return + + if self.ALLOWED.match(variable): + return + if self.REGEX.search(text) is None: + return ["{}:{}: possible typo: {} -> *{}*" + .format(self.filename, lineno, variable, self.package), + text] + + +class UselessFlag(_CheckFunction): + DEFAULT_AUTOTOOLS_FLAG = re.compile("^.*{}".format("|".join([ + "_AUTORECONF\s*=\s*NO", + "_LIBTOOL_PATCH\s*=\s*YES"]))) + DEFAULT_GENERIC_FLAG = re.compile("^.*{}".format("|".join([ + "_INSTALL_IMAGES\s*=\s*NO", + "_INSTALL_REDISTRIBUTE\s*=\s*YES", + "_INSTALL_STAGING\s*=\s*NO", + "_INSTALL_TARGET\s*=\s*YES"]))) + END_CONDITIONAL = re.compile("^\s*(endif)") + START_CONDITIONAL = re.compile("^\s*(ifeq|ifneq)") + + def before(self): + self.conditional = 0 + + def check_line(self, lineno, text): + if self.START_CONDITIONAL.search(text): + self.conditional += 1 + return + if self.END_CONDITIONAL.search(text): + self.conditional -= 1 + return + + # allow non-default conditionally overridden by default + if self.conditional > 0: + return + + if self.DEFAULT_GENERIC_FLAG.search(text): + return ["{}:{}: useless default value ({}#" + "_infrastructure_for_packages_with_specific_build_systems)" + .format(self.filename, lineno, self.url_to_manual), + text] + + if self.DEFAULT_AUTOTOOLS_FLAG.search(text) and not text.lstrip().startswith("HOST_"): + return ["{}:{}: useless default value " + "({}#_infrastructure_for_autotools_based_packages)" + .format(self.filename, lineno, self.url_to_manual), + text] diff --git a/bsp/buildroot/utils/checkpackagelib/lib_patch.py b/bsp/buildroot/utils/checkpackagelib/lib_patch.py new file mode 100644 index 00000000..555621af --- /dev/null +++ b/bsp/buildroot/utils/checkpackagelib/lib_patch.py @@ -0,0 +1,61 @@ +# See utils/checkpackagelib/readme.txt before editing this file. +# The format of the patch files is tested during the build, so below check +# functions don't need to check for things already checked by running +# "make package-dirclean package-patch". + +import re + +from base import _CheckFunction +from lib import NewlineAtEof # noqa: F401 + + +class ApplyOrder(_CheckFunction): + APPLY_ORDER = re.compile("/\d{1,4}-[^/]*$") + + def before(self): + if not self.APPLY_ORDER.search(self.filename): + return ["{}:0: use name -.patch " + "({}#_providing_patches)" + .format(self.filename, self.url_to_manual)] + + +class NumberedSubject(_CheckFunction): + NUMBERED_PATCH = re.compile("Subject:\s*\[PATCH\s*\d+/\d+\]") + + def before(self): + self.git_patch = False + self.lineno = 0 + self.text = None + + def check_line(self, lineno, text): + if text.startswith("diff --git"): + self.git_patch = True + return + if self.NUMBERED_PATCH.search(text): + self.lineno = lineno + self.text = text + + def after(self): + if self.git_patch and self.text: + return ["{}:{}: generate your patches with 'git format-patch -N'" + .format(self.filename, self.lineno), + self.text] + + +class Sob(_CheckFunction): + SOB_ENTRY = re.compile("^Signed-off-by: .*$") + + def before(self): + self.found = False + + def check_line(self, lineno, text): + if self.found: + return + if self.SOB_ENTRY.search(text): + self.found = True + + def after(self): + if not self.found: + return ["{}:0: missing Signed-off-by in the header " + "({}#_format_and_licensing_of_the_package_patches)" + .format(self.filename, self.url_to_manual)] diff --git a/bsp/buildroot/utils/checkpackagelib/readme.txt b/bsp/buildroot/utils/checkpackagelib/readme.txt new file mode 100644 index 00000000..3bfe2896 --- /dev/null +++ b/bsp/buildroot/utils/checkpackagelib/readme.txt @@ -0,0 +1,73 @@ +How the scripts are structured: +- check-package is the main engine, called by the user. + For each input file, this script decides which parser should be used and it + collects all classes declared in the library file and instantiates them. + The main engine opens the input files and it serves each raw line (including + newline!) to the method check_line() of every check object. + Two special methods before() and after() are used to call the initialization + of variables (for the case it needs to keep data across calls) and the + equivalent finalization (e.g. for the case a warning must be issued if some + pattern is not in the input file). +- base.py contains the base class for all check functions. +- lib.py contains the classes for common check functions. + Each check function is explicitly included in a given type-parsing library. + Do not include every single check function in this file, a class that will + only parse hash files should be implemented in the hash-parsing library. + When a warning must be issued, the check function returns an array of strings. + Each string is a warning message and is displayed if the corresponding verbose + level is active. When the script is called without --verbose only the first + warning in the returned array is printed; when called with --verbose both + first and second warnings are printed; when called with -vv until the third + warning is printed; an so on. + Helper functions can be defined and will not be called by the main script. +- lib_type.py contains check functions specific to files of this type. + +Some hints when changing this code: +- prefer O(n) algorithms, where n is the total number of lines in the files + processed. +- when there is no other reason for ordering, use alphabetical order (e.g. keep + the check functions in alphabetical order, keep the imports in alphabetical + order, and so on). +- keep in mind that for every class the method before() will be called before + any line is served to be checked by the method check_line(). A class that + checks the filename should only implement the method before(). A function that + needs to keep data across calls (e.g. keep the last line before the one being + processed) should initialize all variables using this method. +- keep in mind that for every class the method after() will be called after all + lines were served to be checked by the method check_line(). A class that + checks the absence of a pattern in the file will need to use this method. +- try to avoid false warnings. It's better to not issue a warning message to a + corner case than have too many false warnings. The second can make users stop + using the script. +- do not check spacing in the input line in every single function. Trailing + whitespace and wrong indentation should be checked by separate functions. +- avoid duplicate tests. Try to test only one thing in each function. +- in the warning message, include the url to a section from the manual, when + applicable. It potentially will make more people know the manual. +- use short sentences in the warning messages. A complete explanation can be + added to show when --verbose is used. +- when testing, verify the error message is displayed when the error pattern is + found, but also verify the error message is not displayed for few + well-formatted packages... there are many of these, just pick your favorite + as golden package that should not trigger any warning message. +- check the url displayed by the warning message works. + +Usage examples: +- to get a list of check functions that would be called without actually + calling them you can use the --dry-run option: +$ utils/check-package --dry-run package/yourfavorite/* + +- when you just added a new check function, e.g. Something, check how it behaves + for all current packages: +$ utils/check-package --include-only Something $(find package -type f) + +- the effective processing time (when the .pyc were already generated and all + files to be processed are cached in the RAM) should stay in the order of few + seconds: +$ utils/check-package $(find package -type f) >/dev/null ; \ + time utils/check-package $(find package -type f) >/dev/null + +- vim users can navigate the warnings (most editors probably have similar + function) since warnings are generated in the form 'path/file:line: warning': +$ find package/ -name 'Config.*' > filelist && vim -c \ + 'set makeprg=utils/check-package\ $(cat\ filelist)' -c make -c copen diff --git a/bsp/buildroot/utils/config b/bsp/buildroot/utils/config new file mode 100755 index 00000000..c5e2d723 --- /dev/null +++ b/bsp/buildroot/utils/config @@ -0,0 +1,206 @@ +#!/bin/bash +# Manipulate options in a .config file from the command line + +myname=${0##*/} + +# If no prefix forced, use the default BR2_ +BR2_PREFIX="${BR2_PREFIX-BR2_}" + +usage() { + cat >&2 <>"$FN" + fi +} + +undef_var() { + local name=$1 + + txt_delete "^$name=" "$FN" + txt_delete "^# $name is not set" "$FN" +} + +if [ "$1" = "--file" ]; then + FN="$2" + if [ "$FN" = "" ] ; then + usage + fi + shift 2 +else + FN=.config +fi + +if [ "$1" = "" ] ; then + usage +fi + +MUNGE_CASE=yes +while [ "$1" != "" ] ; do + CMD="$1" + shift + case "$CMD" in + --keep-case|-k) + MUNGE_CASE=no + continue + ;; + --package|-p) + BR2_PREFIX="BR2_PACKAGE_" + continue + ;; + --*-after|-E|-D|-M) + checkarg "$1" + A=$ARG + checkarg "$2" + B=$ARG + shift 2 + ;; + -*) + checkarg "$1" + shift + ;; + esac + case "$CMD" in + --enable|-e) + set_var "${BR2_PREFIX}$ARG" "${BR2_PREFIX}$ARG=y" + ;; + + --disable|-d) + set_var "${BR2_PREFIX}$ARG" "# ${BR2_PREFIX}$ARG is not set" + ;; + + --set-str) + # sed swallows one level of escaping, so we need double-escaping + set_var "${BR2_PREFIX}$ARG" "${BR2_PREFIX}$ARG=\"${1//\"/\\\\\"}\"" + shift + ;; + + --set-val) + set_var "${BR2_PREFIX}$ARG" "${BR2_PREFIX}$ARG=$1" + shift + ;; + --undefine|-u) + undef_var "${BR2_PREFIX}$ARG" + ;; + + --state|-s) + if grep -q "# ${BR2_PREFIX}$ARG is not set" $FN ; then + echo n + else + V="$(grep "^${BR2_PREFIX}$ARG=" $FN)" + if [ $? != 0 ] ; then + echo undef + else + V="${V/#${BR2_PREFIX}$ARG=/}" + V="${V/#\"/}" + V="${V/%\"/}" + V="${V//\\\"/\"}" + echo "${V}" + fi + fi + ;; + + --enable-after|-E) + set_var "${BR2_PREFIX}$B" "${BR2_PREFIX}$B=y" "${BR2_PREFIX}$A" + ;; + + --disable-after|-D) + set_var "${BR2_PREFIX}$B" "# ${BR2_PREFIX}$B is not set" "${BR2_PREFIX}$A" + ;; + + *) + usage + ;; + esac +done diff --git a/bsp/buildroot/utils/diffconfig b/bsp/buildroot/utils/diffconfig new file mode 100755 index 00000000..f1af23cf --- /dev/null +++ b/bsp/buildroot/utils/diffconfig @@ -0,0 +1,138 @@ +#!/usr/bin/python +# +# diffconfig - a tool to compare .config files. +# +# originally written in 2006 by Matt Mackall +# (at least, this was in his bloatwatch source code) +# last worked on 2008 by Tim Bird for the Linux kernel +# Adapted to Buildroot 2017 by Marcus Folkesson +# + +import sys, os + +def usage(): + print("""Usage: diffconfig [-h] [-m] [ ] + +Diffconfig is a simple utility for comparing two .config files. +Using standard diff to compare .config files often includes extraneous and +distracting information. This utility produces sorted output with only the +changes in configuration values between the two files. + +Added and removed items are shown with a leading plus or minus, respectively. +Changed items show the old and new values on a single line. + +If -m is specified, then output will be in "merge" style, which has the +changed and new values in kernel config option format. + +If no config files are specified, .config and .config.old are used. + +Example usage: + $ diffconfig .config config-with-some-changes +-BR2_LINUX_KERNEL_INTREE_DTS_NAME "vexpress-v2p-ca9" + BR2_LINUX_KERNEL_DTS_SUPPORT y -> n + BR2_LINUX_KERNEL_USE_INTREE_DTS y -> n + BR2_PACKAGE_DFU_UTIL n -> y + BR2_PACKAGE_LIBUSB n -> y + BR2_TARGET_GENERIC_HOSTNAME "buildroot" -> "Tuxie" + BR2_TARGET_GENERIC_ISSUE "Welcome to Buildroot" -> "Welcome to CustomBoard" ++BR2_PACKAGE_LIBUSB_COMPAT n + +""") + sys.exit(0) + +# returns a dictionary of name/value pairs for config items in the file +def readconfig(config_file): + d = {} + for line in config_file: + line = line.strip() + if len(line) == 0: + continue + if line[-11:] == " is not set": + d[line[2:-11]] = "n" + elif line[0] != "#": + name, val = line.split("=", 1) + d[name] = val + return d + +def print_config(op, config, value, new_value): + global merge_style + + if merge_style: + if new_value: + if new_value=="n": + print("# %s is not set" % config) + else: + print("%s=%s" % (config, new_value)) + else: + if op=="-": + print("-%s %s" % (config, value)) + elif op=="+": + print("+%s %s" % (config, new_value)) + else: + print(" %s %s -> %s" % (config, value, new_value)) + +def main(): + global merge_style + + # parse command line args + if ("-h" in sys.argv or "--help" in sys.argv): + usage() + + merge_style = 0 + if "-m" in sys.argv: + merge_style = 1 + sys.argv.remove("-m") + + argc = len(sys.argv) + if not (argc==1 or argc == 3): + print("Error: incorrect number of arguments or unrecognized option") + usage() + + if argc == 1: + # if no filenames given, assume .config and .config.old + build_dir="" + if "KBUILD_OUTPUT" in os.environ: + build_dir = os.environ["KBUILD_OUTPUT"]+"/" + configa_filename = build_dir + ".config.old" + configb_filename = build_dir + ".config" + else: + configa_filename = sys.argv[1] + configb_filename = sys.argv[2] + + try: + a = readconfig(open(configa_filename)) + b = readconfig(open(configb_filename)) + except (IOError): + e = sys.exc_info()[1] + print("I/O error[%s]: %s\n" % (e.args[0],e.args[1])) + usage() + + # print items in a but not b (accumulate, sort and print) + old = [] + for config in a: + if config not in b: + old.append(config) + old.sort() + for config in old: + print_config("-", config, a[config], None) + del a[config] + + # print items that changed (accumulate, sort, and print) + changed = [] + for config in a: + if a[config] != b[config]: + changed.append(config) + else: + del b[config] + changed.sort() + for config in changed: + print_config("->", config, a[config], b[config]) + del b[config] + + # now print items in b but not in a + # (items from b that were in a were removed above) + new = sorted(b.keys()) + for config in new: + print_config("+", config, None, b[config]) + +main() diff --git a/bsp/buildroot/utils/genrandconfig b/bsp/buildroot/utils/genrandconfig new file mode 100755 index 00000000..fa2c0f7f --- /dev/null +++ b/bsp/buildroot/utils/genrandconfig @@ -0,0 +1,436 @@ +#!/usr/bin/env python + +# Copyright (C) 2014 by Thomas Petazzoni +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +# This script generates a random configuration for testing Buildroot. + +from __future__ import print_function + +import contextlib +import csv +import os +from random import randint +import subprocess +import sys +from distutils.version import StrictVersion +import platform + +if sys.hexversion >= 0x3000000: + import urllib.request as _urllib +else: + import urllib2 as _urllib + + +def urlopen_closing(uri): + return contextlib.closing(_urllib.urlopen(uri)) + + +if sys.hexversion >= 0x3000000: + def decode_byte_list(bl): + return [b.decode() for b in bl] +else: + def decode_byte_list(e): + return e + + +class SystemInfo: + DEFAULT_NEEDED_PROGS = ["make", "git", "gcc", "timeout"] + DEFAULT_OPTIONAL_PROGS = ["bzr", "java", "javac", "jar"] + + def __init__(self): + self.needed_progs = list(self.__class__.DEFAULT_NEEDED_PROGS) + self.optional_progs = list(self.__class__.DEFAULT_OPTIONAL_PROGS) + self.progs = {} + + def find_prog(self, name, flags=os.X_OK, env=os.environ): + if not name or name[0] == os.sep: + raise ValueError(name) + + prog_path = env.get("PATH", None) + # for windows compatibility, we'd need to take PATHEXT into account + + if prog_path: + for prog_dir in filter(None, prog_path.split(os.pathsep)): + # os.join() not necessary: non-empty prog_dir + # and name[0] != os.sep + prog = prog_dir + os.sep + name + if os.access(prog, flags): + return prog + # -- + return None + + def has(self, prog): + """Checks whether a program is available. + Lazily evaluates missing entries. + + Returns: None if prog not found, else path to the program [evaluates + to True] + """ + try: + return self.progs[prog] + except KeyError: + pass + + have_it = self.find_prog(prog) + # java[c] needs special care + if have_it and prog in ('java', 'javac'): + with open(os.devnull, "w") as devnull: + if subprocess.call("%s -version | grep gcj" % prog, + shell=True, + stdout=devnull, stderr=devnull) != 1: + have_it = False + # -- + self.progs[prog] = have_it + return have_it + + def check_requirements(self): + """Checks program dependencies. + + Returns: True if all mandatory programs are present, else False. + """ + do_check_has_prog = self.has + + missing_requirements = False + for prog in self.needed_progs: + if not do_check_has_prog(prog): + print("ERROR: your system lacks the '%s' program" % prog) + missing_requirements = True + + # check optional programs here, + # else they'd get checked by each worker instance + for prog in self.optional_progs: + do_check_has_prog(prog) + + return not missing_requirements + + +def get_toolchain_configs(toolchains_csv, buildrootdir): + """Fetch and return the possible toolchain configurations + + This function returns an array of toolchain configurations. Each + toolchain configuration is itself an array of lines of the defconfig. + """ + + with open(toolchains_csv) as r: + # filter empty lines and comments + lines = [ t for t in r.readlines() if len(t.strip()) > 0 and t[0] != '#' ] + toolchains = decode_byte_list(lines) + configs = [] + + (_, _, _, _, hostarch) = os.uname() + # ~2015 distros report x86 when on a 32bit install + if hostarch == 'i686' or hostarch == 'i386' or hostarch == 'x86': + hostarch = 'x86' + + for row in csv.reader(toolchains): + config = {} + configfile = row[0] + config_hostarch = row[1] + keep = False + + # Keep all toolchain configs that work regardless of the host + # architecture + if config_hostarch == "any": + keep = True + + # Keep all toolchain configs that can work on the current host + # architecture + if hostarch == config_hostarch: + keep = True + + # Assume that x86 32 bits toolchains work on x86_64 build + # machines + if hostarch == 'x86_64' and config_hostarch == "x86": + keep = True + + if not keep: + continue + + if not os.path.isabs(configfile): + configfile = os.path.join(buildrootdir, configfile) + + with open(configfile) as r: + config = r.readlines() + configs.append(config) + return configs + + +def is_toolchain_usable(configfile, config): + """Check if the toolchain is actually usable.""" + + with open(configfile) as configf: + configlines = configf.readlines() + + # Check that the toolchain configuration is still present + for toolchainline in config: + if toolchainline not in configlines: + print("WARN: toolchain can't be used", file=sys.stderr) + print(" Missing: %s" % toolchainline.strip(), file=sys.stderr) + return False + + # The latest Linaro toolchains on x86-64 hosts requires glibc + # 2.14+ on the host. + if platform.machine() == 'x86_64': + if 'BR2_TOOLCHAIN_EXTERNAL_LINARO_ARM=y\n' in configlines or \ + 'BR2_TOOLCHAIN_EXTERNAL_LINARO_AARCH64=y\n' in configlines or \ + 'BR2_TOOLCHAIN_EXTERNAL_LINARO_ARMEB=y\n' in configlines: + ldd_version_output = subprocess.check_output(['ldd', '--version']) + glibc_version = ldd_version_output.splitlines()[0].split()[-1] + if StrictVersion('2.14') > StrictVersion(glibc_version): + print("WARN: ignoring the Linaro ARM toolchains because too old host glibc", file=sys.stderr) + return False + + return True + + +def fixup_config(configfile): + """Finalize the configuration and reject any problematic combinations + + This function returns 'True' when the configuration has been + accepted, and 'False' when the configuration has not been accepted because + it is known to fail (in which case another random configuration will be + generated). + """ + + sysinfo = SystemInfo() + with open(configfile) as configf: + configlines = configf.readlines() + + if "BR2_NEEDS_HOST_JAVA=y\n" in configlines and not sysinfo.has("java"): + return False + if "BR2_NEEDS_HOST_JAVAC=y\n" in configlines and not sysinfo.has("javac"): + return False + if "BR2_NEEDS_HOST_JAR=y\n" in configlines and not sysinfo.has("jar"): + return False + # python-nfc needs bzr + if 'BR2_PACKAGE_PYTHON_NFC=y\n' in configlines and not sysinfo.has("bzr"): + return False + # The ctng toolchain is affected by PR58854 + if 'BR2_PACKAGE_LTTNG_TOOLS=y\n' in configlines and \ + 'BR2_TOOLCHAIN_EXTERNAL_URL="http://autobuild.buildroot.org/toolchains/tarballs/armv5-ctng-linux-gnueabi.tar.xz"\n' in configlines: + return False + # The ctng toolchain tigger an assembler error with guile package when compiled with -Os (same issue as for CS ARM 2014.05-29) + if 'BR2_PACKAGE_GUILE=y\n' in configlines and \ + 'BR2_OPTIMIZE_S=y\n' in configlines and \ + 'BR2_TOOLCHAIN_EXTERNAL_URL="http://autobuild.buildroot.org/toolchains/tarballs/armv5-ctng-linux-gnueabi.tar.xz"\n' in configlines: + return False + # The ctng toolchain is affected by PR58854 + if 'BR2_PACKAGE_LTTNG_TOOLS=y\n' in configlines and \ + 'BR2_TOOLCHAIN_EXTERNAL_URL="http://autobuild.buildroot.org/toolchains/tarballs/armv6-ctng-linux-uclibcgnueabi.tar.xz"\n' in configlines: + return False + # The ctng toolchain is affected by PR58854 + if 'BR2_PACKAGE_LTTNG_TOOLS=y\n' in configlines and \ + 'BR2_TOOLCHAIN_EXTERNAL_URL="http://autobuild.buildroot.org/toolchains/tarballs/armv7-ctng-linux-gnueabihf.tar.xz"\n' in configlines: + return False + # The ctng toolchain is affected by PR60155 + if 'BR2_PACKAGE_SDL=y\n' in configlines and \ + 'BR2_TOOLCHAIN_EXTERNAL_URL="http://autobuild.buildroot.org/toolchains/tarballs/powerpc-ctng-linux-uclibc.tar.xz"\n' in configlines: + return False + # The ctng toolchain is affected by PR60155 + if 'BR2_PACKAGE_LIBMPEG2=y\n' in configlines and \ + 'BR2_TOOLCHAIN_EXTERNAL_URL="http://autobuild.buildroot.org/toolchains/tarballs/powerpc-ctng-linux-uclibc.tar.xz"\n' in configlines: + return False + # This MIPS toolchain uses eglibc-2.18 which lacks SYS_getdents64 + if 'BR2_PACKAGE_STRONGSWAN=y\n' in configlines and \ + 'BR2_TOOLCHAIN_EXTERNAL_URL="http://autobuild.buildroot.org/toolchains/tarballs/mips64el-ctng_n64-linux-gnu.tar.xz"\n' in configlines: + return False + # This MIPS toolchain uses eglibc-2.18 which lacks SYS_getdents64 + if 'BR2_PACKAGE_PYTHON3=y\n' in configlines and \ + 'BR2_TOOLCHAIN_EXTERNAL_URL="http://autobuild.buildroot.org/toolchains/tarballs/mips64el-ctng_n64-linux-gnu.tar.xz"\n' in configlines: + return False + # libffi not available on sh2a and ARMv7-M, but propagating libffi + # arch dependencies in Buildroot is really too much work, so we + # handle this here. + if 'BR2_sh2a=y\n' in configlines and \ + 'BR2_PACKAGE_LIBFFI=y\n' in configlines: + return False + if 'BR2_ARM_CPU_ARMV7M=y\n' in configlines and \ + 'BR2_PACKAGE_LIBFFI=y\n' in configlines: + return False + if 'BR2_PACKAGE_SUNXI_BOARDS=y\n' in configlines: + configlines.remove('BR2_PACKAGE_SUNXI_BOARDS_FEX_FILE=""\n') + configlines.append('BR2_PACKAGE_SUNXI_BOARDS_FEX_FILE="a10/hackberry.fex"\n') + # This MIPS uClibc toolchain fails to build the gdb package + if 'BR2_PACKAGE_GDB=y\n' in configlines and \ + 'BR2_TOOLCHAIN_EXTERNAL_URL="http://autobuild.buildroot.org/toolchains/tarballs/mipsel-ctng-linux-uclibc.tar.xz"\n' in configlines: + return False + # This MIPS uClibc toolchain fails to build the rt-tests package + if 'BR2_PACKAGE_RT_TESTS=y\n' in configlines and \ + 'BR2_TOOLCHAIN_EXTERNAL_URL="http://autobuild.buildroot.org/toolchains/tarballs/mipsel-ctng-linux-uclibc.tar.xz"\n' in configlines: + return False + # This MIPS uClibc toolchain fails to build the civetweb package + if 'BR2_PACKAGE_CIVETWEB=y\n' in configlines and \ + 'BR2_TOOLCHAIN_EXTERNAL_URL="http://autobuild.buildroot.org/toolchains/tarballs/mipsel-ctng-linux-uclibc.tar.xz"\n' in configlines: + return False + # This MIPS ctng toolchain fails to build the python3 package + if 'BR2_PACKAGE_PYTHON3=y\n' in configlines and \ + 'BR2_TOOLCHAIN_EXTERNAL_URL="http://autobuild.buildroot.org/toolchains/tarballs/mips64el-ctng_n64-linux-gnu.tar.xz"\n' in configlines: + return False + # This MIPS uClibc toolchain fails to build the strace package + if 'BR2_PACKAGE_STRACE=y\n' in configlines and \ + 'BR2_TOOLCHAIN_EXTERNAL_URL="http://autobuild.buildroot.org/toolchains/tarballs/mipsel-ctng-linux-uclibc.tar.xz"\n' in configlines: + return False + # This MIPS uClibc toolchain fails to build the cdrkit package + if 'BR2_PACKAGE_CDRKIT=y\n' in configlines and \ + 'BR2_STATIC_LIBS=y\n' in configlines and \ + 'BR2_TOOLCHAIN_EXTERNAL_URL="http://autobuild.buildroot.org/toolchains/tarballs/mipsel-ctng-linux-uclibc.tar.xz"\n' in configlines: + return False + # uClibc vfork static linking issue + if 'BR2_PACKAGE_ALSA_LIB=y\n' in configlines and \ + 'BR2_STATIC_LIBS=y\n' in configlines and \ + 'BR2_TOOLCHAIN_EXTERNAL_URL="http://autobuild.buildroot.org/toolchains/tarballs/i486-ctng-linux-uclibc.tar.xz"\n' in configlines: + return False + # This MIPS uClibc toolchain fails to build the weston package + if 'BR2_PACKAGE_WESTON=y\n' in configlines and \ + 'BR2_TOOLCHAIN_EXTERNAL_URL="http://autobuild.buildroot.org/toolchains/tarballs/mipsel-ctng-linux-uclibc.tar.xz"\n' in configlines: + return False + # The cs nios2 2017.02 toolchain is affected by binutils PR19405 + if 'BR2_TOOLCHAIN_EXTERNAL_CODESOURCERY_NIOSII=y\n' in configlines and \ + 'BR2_PACKAGE_BOOST=y\n' in configlines: + return False + # The cs nios2 2017.02 toolchain is affected by binutils PR19405 + if 'BR2_TOOLCHAIN_EXTERNAL_CODESOURCERY_NIOSII=y\n' in configlines and \ + 'BR2_PACKAGE_QT5BASE_GUI=y\n' in configlines: + return False + # The cs nios2 2017.02 toolchain is affected by binutils PR19405 + if 'BR2_TOOLCHAIN_EXTERNAL_CODESOURCERY_NIOSII=y\n' in configlines and \ + 'BR2_PACKAGE_QT_GUI_MODULE=y\n' in configlines: + return False + # The cs nios2 2017.02 toolchain is affected by binutils PR19405 + if 'BR2_TOOLCHAIN_EXTERNAL_CODESOURCERY_NIOSII=y\n' in configlines and \ + 'BR2_PACKAGE_FLANN=y\n' in configlines: + return False + # or1k affected by binutils PR21464 + if 'BR2_or1k=y\n' in configlines and \ + 'BR2_PACKAGE_QT_GUI_MODULE=y\n' in configlines: + return False + + with open(configfile, "w+") as configf: + configf.writelines(configlines) + + return True + + +def gen_config(args): + """Generate a new random configuration + + This function generates the configuration, by choosing a random + toolchain configuration and then generating a random selection of + packages. + """ + + # Select a random toolchain configuration + configs = get_toolchain_configs(args.toolchains_csv, args.buildrootdir) + + i = randint(0, len(configs) - 1) + toolchainconfig = configs[i] + + configlines = list(toolchainconfig) + + # Combine with the minimal configuration + minimalconfigfile = os.path.join(args.buildrootdir, + 'support/config-fragments/minimal.config') + with open(minimalconfigfile) as minimalf: + configlines += minimalf.readlines() + + # Allow hosts with old certificates to download over https + configlines.append("BR2_WGET=\"wget --passive-ftp -nd -t 3 --no-check-certificate\"\n") + + # Amend the configuration with a few things. + if randint(0, 20) == 0: + configlines.append("BR2_ENABLE_DEBUG=y\n") + if randint(0, 1) == 0: + configlines.append("BR2_INIT_BUSYBOX=y\n") + elif randint(0, 15) == 0: + configlines.append("BR2_INIT_SYSTEMD=y\n") + elif randint(0, 10) == 0: + configlines.append("BR2_ROOTFS_DEVICE_CREATION_DYNAMIC_EUDEV=y\n") + if randint(0, 20) == 0: + configlines.append("BR2_STATIC_LIBS=y\n") + if randint(0, 20) == 0: + configlines.append("BR2_PACKAGE_PYTHON_PY_ONLY=y\n") + + # Write out the configuration file + if not os.path.exists(args.outputdir): + os.makedirs(args.outputdir) + if args.outputdir == os.path.abspath(os.path.join(args.buildrootdir, "output")): + configfile = os.path.join(args.buildrootdir, ".config") + else: + configfile = os.path.join(args.outputdir, ".config") + with open(configfile, "w+") as configf: + configf.writelines(configlines) + + subprocess.check_call(["make", "O=%s" % args.outputdir, "-C", args.buildrootdir, + "olddefconfig"]) + + if not is_toolchain_usable(configfile, toolchainconfig): + return 2 + + # Now, generate the random selection of packages, and fixup + # things if needed. + # Safe-guard, in case we can not quickly come to a valid + # configuration: allow at most 100 (arbitrary) iterations. + bounded_loop = 100 + while True: + if bounded_loop == 0: + print("ERROR: cannot generate random configuration after 100 iterations", + file=sys.stderr) + return 1 + bounded_loop -= 1 + subprocess.check_call(["make", "O=%s" % args.outputdir, "-C", args.buildrootdir, + "KCONFIG_PROBABILITY=%d" % randint(1, 30), + "randpackageconfig"]) + + if fixup_config(configfile): + break + + subprocess.check_call(["make", "O=%s" % args.outputdir, "-C", args.buildrootdir, + "olddefconfig"]) + + subprocess.check_call(["make", "O=%s" % args.outputdir, "-C", args.buildrootdir, + "savedefconfig"]) + + return subprocess.call(["make", "O=%s" % args.outputdir, "-C", args.buildrootdir, + "core-dependencies"]) + + +if __name__ == '__main__': + import argparse + parser = argparse.ArgumentParser(description="Generate a random configuration") + parser.add_argument("--outputdir", "-o", + help="Output directory (relative to current directory)", + type=str, default='output') + parser.add_argument("--buildrootdir", "-b", + help="Buildroot directory (relative to current directory)", + type=str, default='.') + parser.add_argument("--toolchains-csv", + help="Path of the toolchain configuration file", + type=str, + default="support/config-fragments/autobuild/toolchain-configs.csv") + args = parser.parse_args() + + # We need the absolute path to use with O=, because the relative + # path to the output directory here is not relative to the + # Buildroot sources, but to the current directory. + args.outputdir = os.path.abspath(args.outputdir) + + try: + ret = gen_config(args) + except Exception as e: + print(str(e), file=sys.stderr) + parser.exit(1) + parser.exit(ret) diff --git a/bsp/buildroot/utils/get-developers b/bsp/buildroot/utils/get-developers new file mode 100755 index 00000000..c8879388 --- /dev/null +++ b/bsp/buildroot/utils/get-developers @@ -0,0 +1,109 @@ +#!/usr/bin/env python + +import argparse +import getdeveloperlib +import sys +import os + + +def parse_args(): + parser = argparse.ArgumentParser() + parser.add_argument('patches', metavar='P', type=argparse.FileType('r'), nargs='*', + help='list of patches (use - to read patches from stdin)') + parser.add_argument('-a', dest='architecture', action='store', + help='find developers in charge of this architecture') + parser.add_argument('-p', dest='package', action='store', + help='find developers in charge of this package') + parser.add_argument('-f', dest='files', nargs='*', + help='find developers in charge of these files') + parser.add_argument('-c', dest='check', action='store_const', + const=True, help='list files not handled by any developer') + parser.add_argument('-e', dest='email', action='store_const', + const=True, help='only list affected developer email addresses') + return parser.parse_args() + + +def __main__(): + # DEVELOPERS is one level up from here + devs_dir = os.path.join(os.path.dirname(os.path.realpath(__file__)), '..') + devs = getdeveloperlib.parse_developers(devs_dir) + if devs is None: + sys.exit(1) + args = parse_args() + + # Check that only one action is given + action = 0 + if args.architecture is not None: + action += 1 + if args.package is not None: + action += 1 + if args.files: + action += 1 + if args.check: + action += 1 + if len(args.patches) != 0: + action += 1 + if action > 1: + print("Cannot do more than one action") + return + if action == 0: + print("No action specified") + return + + # Handle the check action + if args.check: + files = getdeveloperlib.check_developers(devs, devs_dir) + for f in files: + print(f) + + # Handle the architecture action + if args.architecture is not None: + for dev in devs: + if args.architecture in dev.architectures: + print(dev.name) + return + + # Handle the package action + if args.package is not None: + for dev in devs: + if args.package in dev.packages: + print(dev.name) + return + + # Handle the files action + if args.files is not None: + args.files = [os.path.abspath(f) for f in args.files] + for dev in devs: + for devfile in dev.files: + commonfiles = [f for f in args.files if f.startswith(devfile)] + if commonfiles: + print(dev.name) + break + + # Handle the patches action + if len(args.patches) != 0: + (files, infras) = getdeveloperlib.analyze_patches(args.patches) + matching_devs = set() + for dev in devs: + # See if we have developers matching by package name + for f in files: + if dev.hasfile(f): + matching_devs.add(dev.name) + # See if we have developers matching by package infra + for i in infras: + if i in dev.infras: + matching_devs.add(dev.name) + + if args.email: + for dev in matching_devs: + print(dev) + else: + result = "--to buildroot@buildroot.org" + for dev in matching_devs: + result += " --cc \"%s\"" % dev + + if result != "": + print("git send-email %s" % result) + + +__main__() diff --git a/bsp/buildroot/utils/getdeveloperlib.py b/bsp/buildroot/utils/getdeveloperlib.py new file mode 100644 index 00000000..84665520 --- /dev/null +++ b/bsp/buildroot/utils/getdeveloperlib.py @@ -0,0 +1,212 @@ +import os +import re +import glob +import subprocess + +# +# Patch parsing functions +# + +FIND_INFRA_IN_PATCH = re.compile("^\+\$\(eval \$\((host-)?([^-]*)-package\)\)$") + + +def analyze_patch(patch): + """Parse one patch and return the list of files modified, added or + removed by the patch.""" + files = set() + infras = set() + for line in patch: + # If the patch is adding a package, find which infra it is + m = FIND_INFRA_IN_PATCH.match(line) + if m: + infras.add(m.group(2)) + if not line.startswith("+++ "): + continue + line.strip() + fname = line[line.find("/") + 1:].strip() + if fname == "dev/null": + continue + files.add(fname) + return (files, infras) + + +FIND_INFRA_IN_MK = re.compile("^\$\(eval \$\((host-)?([^-]*)-package\)\)$") + + +def fname_get_package_infra(fname): + """Checks whether the file name passed as argument is a Buildroot .mk + file describing a package, and find the infrastructure it's using.""" + if not fname.endswith(".mk"): + return None + + if not os.path.exists(fname): + return None + + with open(fname, "r") as f: + for line in f: + line = line.strip() + m = FIND_INFRA_IN_MK.match(line) + if m: + return m.group(2) + return None + + +def get_infras(files): + """Search in the list of files for .mk files, and collect the package + infrastructures used by those .mk files.""" + infras = set() + for fname in files: + infra = fname_get_package_infra(fname) + if infra: + infras.add(infra) + return infras + + +def analyze_patches(patches): + """Parse a list of patches and returns the list of files modified, + added or removed by the patches, as well as the list of package + infrastructures used by those patches (if any)""" + allfiles = set() + allinfras = set() + for patch in patches: + (files, infras) = analyze_patch(patch) + allfiles = allfiles | files + allinfras = allinfras | infras + allinfras = allinfras | get_infras(allfiles) + return (allfiles, allinfras) + + +# +# DEVELOPERS file parsing functions +# + +class Developer: + def __init__(self, name, files): + self.name = name + self.files = files + self.packages = parse_developer_packages(files) + self.architectures = parse_developer_architectures(files) + self.infras = parse_developer_infras(files) + + def hasfile(self, f): + f = os.path.abspath(f) + for fs in self.files: + if f.startswith(fs): + return True + return False + + +def parse_developer_packages(fnames): + """Given a list of file patterns, travel through the Buildroot source + tree to find which packages are implemented by those file + patterns, and return a list of those packages.""" + packages = set() + for fname in fnames: + for root, dirs, files in os.walk(fname): + for f in files: + path = os.path.join(root, f) + if fname_get_package_infra(path): + pkg = os.path.splitext(f)[0] + packages.add(pkg) + return packages + + +def parse_arches_from_config_in(fname): + """Given a path to an arch/Config.in.* file, parse it to get the list + of BR2_ARCH values for this architecture.""" + arches = set() + with open(fname, "r") as f: + parsing_arches = False + for line in f: + line = line.strip() + if line == "config BR2_ARCH": + parsing_arches = True + continue + if parsing_arches: + m = re.match("^\s*default \"([^\"]*)\".*", line) + if m: + arches.add(m.group(1)) + else: + parsing_arches = False + return arches + + +def parse_developer_architectures(fnames): + """Given a list of file names, find the ones starting by + 'arch/Config.in.', and use that to determine the architecture a + developer is working on.""" + arches = set() + for fname in fnames: + if not re.match("^.*/arch/Config\.in\..*$", fname): + continue + arches = arches | parse_arches_from_config_in(fname) + return arches + + +def parse_developer_infras(fnames): + infras = set() + for fname in fnames: + m = re.match("^package/pkg-([^.]*).mk$", fname) + if m: + infras.add(m.group(1)) + return infras + + +def parse_developers(basepath=None): + """Parse the DEVELOPERS file and return a list of Developer objects.""" + developers = [] + linen = 0 + if basepath is None: + basepath = os.getcwd() + else: + basepath = os.path.abspath(basepath) + with open(os.path.join(basepath, "DEVELOPERS"), "r") as f: + files = [] + name = None + for line in f: + line = line.strip() + if line.startswith("#"): + continue + elif line.startswith("N:"): + if name is not None or len(files) != 0: + print("Syntax error in DEVELOPERS file, line %d" % linen) + name = line[2:].strip() + elif line.startswith("F:"): + fname = line[2:].strip() + dev_files = glob.glob(os.path.join(basepath, fname)) + if len(dev_files) == 0: + print("WARNING: '%s' doesn't match any file" % fname) + files += dev_files + elif line == "": + if not name: + continue + developers.append(Developer(name, files)) + files = [] + name = None + else: + print("Syntax error in DEVELOPERS file, line %d: '%s'" % (linen, line)) + return None + linen += 1 + # handle last developer + if name is not None: + developers.append(Developer(name, files)) + return developers + + +def check_developers(developers, basepath=None): + """Look at the list of files versioned in Buildroot, and returns the + list of files that are not handled by any developer""" + if basepath is None: + basepath = os.getcwd() + cmd = ["git", "--git-dir", os.path.join(basepath, ".git"), "ls-files"] + files = subprocess.check_output(cmd).strip().split("\n") + unhandled_files = [] + for f in files: + handled = False + for d in developers: + if d.hasfile(os.path.join(basepath, f)): + handled = True + break + if not handled: + unhandled_files.append(f) + return unhandled_files diff --git a/bsp/buildroot/utils/readme.txt b/bsp/buildroot/utils/readme.txt new file mode 100644 index 00000000..3064ecec --- /dev/null +++ b/bsp/buildroot/utils/readme.txt @@ -0,0 +1,45 @@ +This directory contains various useful scripts and tools for working +with Buildroot. You need not add this directory in your PATH to use +any of those tools, but you may do so if you want. + +brmake + a script that can be run instead of make, that prepends the date in + front of each line, redirects all of the build output to a file + ("'br.log' in the current directory), and just outputs the Buildroot + messages (those lines starting with >>>) on stdout. + Do not run this script for interactive configuration (e.g. menuconfig) + or on an unconfigured directory. The output is redirected so you will see + nothing. + +check-package + a script that checks the coding style of a package's Config.in and + .mk files, and also tests them for various types of typoes. + +genrandconfig + a script that generates a random configuration, used by the autobuilders + (http://autobuild.buildroot.org). It selects a random toolchain from + support/config-fragments/autobuild and randomly selects packages to build. + +get-developpers + a script to return the list of people interested in a specific part + of Buildroot, so they can be Cc:ed on a mail. Accepts a patch as + input, a package name or and architecture name. + +scancpan + a script to create a Buildroot package by scanning a CPAN module + description. + +scanpypi + a script to create a Buildroot package by scanning a PyPI package + description. + +size-stats-compare + a script to compare the rootfs size between two different Buildroot + configurations. This can be used to identify the size impact of + a specific option, of a set of specific options, or of an update + to a newer Buildroot version... + +test-pkg + a script that tests a specific package against a set of various + toolchains, with the goal to detect toolchain-related dependencies + (wchar, threads...) diff --git a/bsp/buildroot/utils/scancpan b/bsp/buildroot/utils/scancpan new file mode 100755 index 00000000..6d1cdc57 --- /dev/null +++ b/bsp/buildroot/utils/scancpan @@ -0,0 +1,864 @@ +#!/usr/bin/env perl + +# This chunk of stuff was generated by App::FatPacker. To find the original +# file's code, look for the end of this BEGIN block or the string 'FATPACK' +BEGIN { +my %fatpacked; + +$fatpacked{"MetaCPAN/API/Tiny.pm"} = <<'METACPAN_API_TINY'; + package MetaCPAN::API::Tiny; + { + $MetaCPAN::API::Tiny::VERSION = '1.131730'; + } + use strict; + use warnings; + # ABSTRACT: A Tiny API client for MetaCPAN + + use Carp; + use JSON::PP 'encode_json', 'decode_json'; + use HTTP::Tiny; + + + sub new { + my ($class, @args) = @_; + + $#_ % 2 == 0 + or croak 'Arguments must be provided as name/value pairs'; + + my %params = @args; + + die 'ua_args must be an array reference' + if $params{ua_args} && ref($params{ua_args}) ne 'ARRAY'; + + my $self = +{ + base_url => $params{base_url} || 'http://api.metacpan.org/v0', + ua => $params{ua} || HTTP::Tiny->new( + $params{ua_args} + ? @{$params{ua_args}} + : (agent => 'MetaCPAN::API::Tiny/' + . ($MetaCPAN::API::VERSION || 'xx'))), + }; + + return bless($self, $class); + } + + sub _build_extra_params { + my $self = shift; + + @_ % 2 == 0 + or croak 'Incorrect number of params, must be key/value'; + + my %extra = @_; + my $ua = $self->{ua}; + + foreach my $key (keys %extra) + { + # The implementation in HTTP::Tiny uses + instead of %20, fix that + $extra{$key} = $ua->_uri_escape($extra{$key}); + $extra{$key} =~ s/\+/%20/g; + } + + my $params = join '&', map { "$_=" . $extra{$_} } sort keys %extra; + + return $params; + } + + + # /source/{author}/{release}/{path} + sub source { + my $self = shift; + my %opts = @_ ? @_ : (); + my $url = ''; + my $error = "Provide 'author' and 'release' and 'path'"; + + %opts or croak $error; + + if ( + defined ( my $author = $opts{'author'} ) && + defined ( my $release = $opts{'release'} ) && + defined ( my $path = $opts{'path'} ) + ) { + $url = "source/$author/$release/$path"; + } else { + croak $error; + } + + $url = $self->{base_url} . "/$url"; + + my $result = $self->{ua}->get($url); + $result->{'success'} + or croak "Failed to fetch '$url': " . $result->{'reason'}; + + return $result->{'content'}; + } + + + # /release/{distribution} + # /release/{author}/{release} + sub release { + my $self = shift; + my %opts = @_ ? @_ : (); + my $url = ''; + my $error = "Either provide 'distribution', or 'author' and 'release', " . + "or 'search'"; + + %opts or croak $error; + + my %extra_opts = (); + + if ( defined ( my $dist = $opts{'distribution'} ) ) { + $url = "release/$dist"; + } elsif ( + defined ( my $author = $opts{'author'} ) && + defined ( my $release = $opts{'release'} ) + ) { + $url = "release/$author/$release"; + } elsif ( defined ( my $search_opts = $opts{'search'} ) ) { + ref $search_opts && ref $search_opts eq 'HASH' + or croak $error; + + %extra_opts = %{$search_opts}; + $url = 'release/_search'; + } else { + croak $error; + } + + return $self->fetch( $url, %extra_opts ); + } + + + # /pod/{module} + # /pod/{author}/{release}/{path} + sub pod { + my $self = shift; + my %opts = @_ ? @_ : (); + my $url = ''; + my $error = "Either provide 'module' or 'author and 'release' and 'path'"; + + %opts or croak $error; + + if ( defined ( my $module = $opts{'module'} ) ) { + $url = "pod/$module"; + } elsif ( + defined ( my $author = $opts{'author'} ) && + defined ( my $release = $opts{'release'} ) && + defined ( my $path = $opts{'path'} ) + ) { + $url = "pod/$author/$release/$path"; + } else { + croak $error; + } + + # check content-type + my %extra = (); + if ( defined ( my $type = $opts{'content-type'} ) ) { + $type =~ m{^ text/ (?: html|plain|x-pod|x-markdown ) $}x + or croak 'Incorrect content-type provided'; + + $extra{headers}{'content-type'} = $type; + } + + $url = $self->{base_url}. "/$url"; + + my $result = $self->{ua}->get( $url, \%extra ); + $result->{'success'} + or croak "Failed to fetch '$url': " . $result->{'reason'}; + + return $result->{'content'}; + } + + + # /module/{module} + sub module { + my $self = shift; + my $name = shift; + + $name or croak 'Please provide a module name'; + + return $self->fetch("module/$name"); + } + + + # file() is a synonym of module + sub file { goto &module } + + + # /author/{author} + sub author { + my $self = shift; + my ( $pause_id, $url, %extra_opts ); + + if ( @_ == 1 ) { + $url = 'author/' . shift; + } elsif ( @_ == 2 ) { + my %opts = @_; + + if ( defined $opts{'pauseid'} ) { + $url = "author/" . $opts{'pauseid'}; + } elsif ( defined $opts{'search'} ) { + my $search_opts = $opts{'search'}; + + ref $search_opts && ref $search_opts eq 'HASH' + or croak "'search' key must be hashref"; + + %extra_opts = %{$search_opts}; + $url = 'author/_search'; + } else { + croak 'Unknown option given'; + } + } else { + croak 'Please provide an author PAUSEID or a "search"'; + } + + return $self->fetch( $url, %extra_opts ); + } + + + + sub fetch { + my $self = shift; + my $url = shift; + my $extra = $self->_build_extra_params(@_); + my $base = $self->{base_url}; + my $req_url = $extra ? "$base/$url?$extra" : "$base/$url"; + + my $result = $self->{ua}->get($req_url); + return $self->_decode_result( $result, $req_url ); + } + + + sub post { + my $self = shift; + my $url = shift; + my $query = shift; + my $base = $self->{base_url}; + + defined $url + or croak 'First argument of URL must be provided'; + + ref $query and ref $query eq 'HASH' + or croak 'Second argument of query hashref must be provided'; + + my $query_json = encode_json( $query ); + my $result = $self->{ua}->request( + 'POST', + "$base/$url", + { + headers => { 'Content-Type' => 'application/json' }, + content => $query_json, + } + ); + + return $self->_decode_result( $result, $url, $query_json ); + } + + sub _decode_result { + my $self = shift; + my ( $result, $url, $original ) = @_; + my $decoded_result; + + ref $result and ref $result eq 'HASH' + or croak 'First argument must be hashref'; + + defined $url + or croak 'Second argument of a URL must be provided'; + + if ( defined ( my $success = $result->{'success'} ) ) { + my $reason = $result->{'reason'} || ''; + $reason .= ( defined $original ? " (request: $original)" : '' ); + + $success or croak "Failed to fetch '$url': $reason"; + } else { + croak 'Missing success in return value'; + } + + defined ( my $content = $result->{'content'} ) + or croak 'Missing content in return value'; + + eval { $decoded_result = decode_json $content; 1 } + or do { croak "Couldn't decode '$content': $@" }; + + return $decoded_result; + } + + 1; + + __END__ + + =pod + + =head1 NAME + + MetaCPAN::API::Tiny - A Tiny API client for MetaCPAN + + =head1 VERSION + + version 1.131730 + + =head1 DESCRIPTION + + This is the Tiny version of L. It implements a compatible API + with a few notable exceptions: + + =over 4 + + =item Attributes are direct hash access + + The attributes defined using Mo(o|u)se are now accessed via the blessed hash + directly. There are no accessors defined to access this elements. + + =item Exception handling + + Instead of using Try::Tiny, raw evals are used. This could potentially cause + issues, so just be aware. + + =item Testing + + Test::Fatal was replaced with an eval implementation of exception(). + Test::TinyMocker usage is retained, but may be absorbed since it is pure perl + + =back + + =head1 CLASS_METHODS + + =head2 new + + new is the constructor for MetaCPAN::API::Tiny. In the non-tiny version of this + module, this is provided via Any::Moose built from the attributes defined. In + the tiny version, we define our own constructor. It takes the same arguments + and provides similar checks to MetaCPAN::API with regards to arguments passed. + + =head1 PUBLIC_METHODS + + =head2 source + + my $source = $mcpan->source( + author => 'DOY', + release => 'Moose-2.0201', + path => 'lib/Moose.pm', + ); + + Searches MetaCPAN for a module or a specific release and returns the plain source. + + =head2 release + + my $result = $mcpan->release( distribution => 'Moose' ); + + # or + my $result = $mcpan->release( author => 'DOY', release => 'Moose-2.0001' ); + + Searches MetaCPAN for a dist. + + You can do complex searches using 'search' parameter: + + # example lifted from MetaCPAN docs + my $result = $mcpan->release( + search => { + author => "OALDERS AND ", + filter => "status:latest", + fields => "name", + size => 1, + }, + ); + + =head2 pod + + my $result = $mcpan->pod( module => 'Moose' ); + + # or + my $result = $mcpan->pod( + author => 'DOY', + release => 'Moose-2.0201', + path => 'lib/Moose.pm', + ); + + Searches MetaCPAN for a module or a specific release and returns the POD. + + =head2 module + + my $result = $mcpan->module('MetaCPAN::API'); + + Searches MetaCPAN and returns a module's ".pm" file. + + =head2 file + + A synonym of L + + =head2 author + + my $result1 = $mcpan->author('XSAWYERX'); + my $result2 = $mcpan->author( pauseid => 'XSAWYERX' ); + + Searches MetaCPAN for a specific author. + + You can do complex searches using 'search' parameter: + + # example lifted from MetaCPAN docs + my $result = $mcpan->author( + search => { + q => 'profile.name:twitter', + size => 1, + }, + ); + + =head2 fetch + + my $result = $mcpan->fetch('/release/distribution/Moose'); + + # with parameters + my $more = $mcpan->fetch( + '/release/distribution/Moose', + param => 'value', + ); + + This is a helper method for API implementations. It fetches a path from MetaCPAN, decodes the JSON from the content variable and returns it. + + You don't really need to use it, but you can in case you want to write your own extension implementation to MetaCPAN::API. + + It accepts an additional hash as "GET" parameters. + + =head2 post + + # /release&content={"query":{"match_all":{}},"filter":{"prefix":{"archive":"Cache-Cache-1.06"}}} + my $result = $mcpan->post( + 'release', + { + query => { match_all => {} }, + filter => { prefix => { archive => 'Cache-Cache-1.06' } }, + }, + ); + + The POST equivalent of the "fetch()" method. It gets the path and JSON request. + + =head1 THANKS + + Overall the tests and code were ripped directly from MetaCPAN::API and + tiny-fied. A big thanks to Sawyer X for writing the original module. + + =head1 AUTHOR + + Nicholas R. Perez + + =head1 COPYRIGHT AND LICENSE + + This software is copyright (c) 2013 by Nicholas R. Perez . + + This is free software; you can redistribute it and/or modify it under + the same terms as the Perl 5 programming language system itself. + + =cut +METACPAN_API_TINY + +s/^ //mg for values %fatpacked; + +unshift @INC, sub { + if (my $fat = $fatpacked{$_[1]}) { + if ($] < 5.008) { + return sub { + return 0 unless length $fat; + $fat =~ s/^([^\n]*\n?)//; + $_ = $1; + return 1; + }; + } + open my $fh, '<', \$fat + or die "FatPacker error loading $_[1] (could be a perl installation issue?)"; + return $fh; + } + return +}; + +} # END OF FATPACK CODE + + +use 5.010; +use strict; +use warnings; +use Fatal qw(open close); + +use Getopt::Long; +use Pod::Usage; +use File::Basename; +use Module::CoreList; +use HTTP::Tiny; +use Safe; +use MetaCPAN::API::Tiny; + +# Below, 5.026 should be aligned with the version of perl actually +# bundled in Buildroot: +die <<"MSG" if $] < 5.026; +This script needs a host perl with the same major version as Buildroot target perl. + +Your current host perl is: + $^X + version $] + +You may install a local one by running: + perlbrew install perl-5.26.0 +MSG + +my ($help, $man, $quiet, $force, $recommend, $test, $host); +my $target = 1; +GetOptions( 'help|?' => \$help, + 'man' => \$man, + 'quiet|q' => \$quiet, + 'force|f' => \$force, + 'host!' => \$host, + 'target!' => \$target, + 'recommend' => \$recommend, + 'test' => \$test +) or pod2usage(-exitval => 1); +pod2usage(-exitval => 0) if $help; +pod2usage(-exitval => 0, -verbose => 2) if $man; +pod2usage(-exitval => 1) if scalar @ARGV == 0; + +my %dist; # name -> metacpan data +my %need_target; # name -> 1 if target package is needed +my %need_host; # name -> 1 if host package is needed +my %need_dlopen; # name -> 1 if requires dynamic library +my %deps_build; # name -> list of host dependencies +my %deps_runtime; # name -> list of target dependencies +my %deps_optional; # name -> list of optional target dependencies +my %license_files; # name -> list of license files +my %checksum; # author -> list of checksum +my $mirror = 'http://cpan.metacpan.org'; # a CPAN mirror +my $mcpan = MetaCPAN::API::Tiny->new(base_url => 'http://fastapi.metacpan.org/v1'); +my $ua = HTTP::Tiny->new(); + +sub get_checksum { + my ($url) = @_; + my ($path) = $url =~ m|^[^:/?#]+://[^/?#]*([^?#]*)|; + my ($basename, $dirname) = fileparse( $path ); + unless ($checksum{$dirname}) { + my $url = $mirror . $dirname . q{CHECKSUMS}; + my $response = $ua->get($url); + $checksum{$dirname} = $response->{content}; + } + my $chksum = Safe->new->reval($checksum{$dirname}); + return $chksum->{$basename}, $basename; +} + +sub is_xs { + my ($manifest) = @_; + # This heuristic determines if a module is a native extension, by searching + # some file extension types in the MANIFEST of the distribution. + # It was inspired by http://deps.cpantesters.org/static/purity.html + return $manifest =~ m/\.(swg|xs|c|h|i)[\n\s]/; +} + +sub find_license_files { + my ($manifest) = @_; + my @license_files; + foreach (split /\n/, $manifest) { + next if m|/|; + push @license_files, $_ if m/(ARTISTIC|COPYING|COPYRIGHT|LICENSE)/i; + } + if (scalar @license_files == 0 && $manifest =~ m/(README)[\n\s]/i) { + @license_files = ($1); + } + return \@license_files; +} + +sub fetch { + my ($name, $need_target, $need_host, $top) = @_; + $need_target{$name} = $need_target if $need_target; + $need_host{$name} = $need_host if $need_host; + unless ($dist{$name} && !$top) { + say qq{fetch ${name}} unless $quiet; + my $result = $mcpan->release( distribution => $name ); + $dist{$name} = $result; + eval { + my $manifest = $mcpan->source( author => $result->{author}, + release => $name . q{-} . $result->{version}, + path => 'MANIFEST' ); + $need_dlopen{$name} = is_xs( $manifest ); + $license_files{$name} = find_license_files( $manifest ); + }; + if ($@) { + warn $@; + $license_files{$name} = []; + } + my %build = (); + my %runtime = (); + my %optional = (); + foreach my $dep (@{$result->{dependency}}) { + my $modname = ${$dep}{module}; + next if $modname eq q{perl}; + next if $modname =~ m|^Alien|; + next if $modname =~ m|^Win32|; + next if !($test && $top) && $modname =~ m|^Test|; + next if Module::CoreList::is_core( $modname, undef, $] ); + # we could use the host Module::CoreList data, because host perl and + # target perl have the same major version + next if ${$dep}{phase} eq q{develop}; + next if !($test && $top) && ${$dep}{phase} eq q{test}; + my $distname = $mcpan->module( $modname )->{distribution}; + if (${$dep}{phase} eq q{runtime}) { + if (${$dep}{relationship} eq q{requires}) { + $runtime{$distname} = 1; + } + else { + $optional{$distname} = 1 if $recommend && $top; + } + } + else { # configure, build + $build{$distname} = 1; + } + } + $deps_build{$name} = [keys %build]; + $deps_runtime{$name} = [keys %runtime]; + $deps_optional{$name} = [keys %optional]; + foreach my $distname (@{$deps_build{$name}}) { + fetch( $distname, 0, 1 ); + } + foreach my $distname (@{$deps_runtime{$name}}) { + fetch( $distname, $need_target, $need_host ); + $need_dlopen{$name} ||= $need_dlopen{$distname}; + } + foreach my $distname (@{$deps_optional{$name}}) { + fetch( $distname, $need_target, $need_host ); + } + } + return; +} + +foreach my $distname (@ARGV) { + # Command-line's distributions + fetch( $distname, !!$target, !!$host, 1 ); +} +say scalar keys %dist, q{ packages fetched.} unless $quiet; + +# Buildroot package name: lowercase +sub fsname { + my $name = shift; + $name =~ s|_|-|g; + return q{perl-} . lc $name; +} + +# Buildroot variable name: uppercase +sub brname { + my $name = shift; + $name =~ s|-|_|g; + return uc $name; +} + +while (my ($distname, $dist) = each %dist) { + my $fsname = fsname( $distname ); + my $dirname = q{package/} . $fsname; + my $cfgname = $dirname . q{/Config.in}; + my $mkname = $dirname . q{/} . $fsname . q{.mk}; + my $hashname = $dirname . q{/} . $fsname . q{.hash}; + my $brname = brname( $fsname ); + mkdir $dirname unless -d $dirname; + if ($need_target{$distname} && ($force || !-f $cfgname)) { + my $abstract = $dist->{abstract}; + my $homepage = $dist->{resources}->{homepage} || qq{https://metacpan.org/release/${distname}}; + say qq{write ${cfgname}} unless $quiet; + open my $fh, q{>}, $cfgname; + say {$fh} qq{config BR2_PACKAGE_${brname}}; + say {$fh} qq{\tbool "${fsname}"}; + say {$fh} qq{\tdepends on !BR2_STATIC_LIBS} if $need_dlopen{$distname}; + foreach my $dep (sort @{$deps_runtime{$distname}}) { + my $brdep = brname( fsname( $dep ) ); + say {$fh} qq{\tselect BR2_PACKAGE_${brdep}}; + } + say {$fh} qq{\thelp}; + say {$fh} qq{\t ${abstract}\n} if $abstract; + say {$fh} qq{\t ${homepage}}; + if ($need_dlopen{$distname}) { + say {$fh} qq{\ncomment "${fsname} needs a toolchain w/ dynamic library"}; + say {$fh} qq{\tdepends on BR2_STATIC_LIBS}; + } + close $fh; + } + if ($force || !-f $mkname) { + my $version = $dist->{version}; + my ($path) = $dist->{download_url} =~ m|^[^:/?#]+://[^/?#]*([^?#]*)|; + # this URL contains only the scheme, auth and path parts (but no query and fragment parts) + # the scheme is not used, because the job is done by the BR download infrastructure + # the auth part is not used, because we use $(BR2_CPAN_MIRROR) + my ($filename, $directories, $suffix) = fileparse( $path, q{tar.gz}, q{tgz} ); + $directories =~ s|/$||; + my $dependencies = join q{ }, map( { q{host-} . fsname( $_ ); } sort @{$deps_build{$distname}} ), + map( { fsname( $_ ); } sort @{$deps_runtime{$distname}} ); + my $host_dependencies = join q{ }, map { q{host-} . fsname( $_ ); } sort( @{$deps_build{$distname}}, + @{$deps_runtime{$distname}} ); + my $license = ref $dist->{license} eq 'ARRAY' + ? join q{ or }, @{$dist->{license}} + : $dist->{license}; + # BR requires license name as in http://spdx.org/licenses/ + $license =~ s|apache_2_0|Apache-2.0|; + $license =~ s|artistic_2|Artistic-2.0|; + $license =~ s|mit|MIT|; + $license =~ s|openssl|OpenSSL|; + $license =~ s|perl_5|Artistic or GPL-1.0+|; + my $license_files = join q{ }, @{$license_files{$distname}}; + say qq{write ${mkname}} unless $quiet; + open my $fh, q{>}, $mkname; + say {$fh} qq{################################################################################}; + say {$fh} qq{#}; + say {$fh} qq{# ${fsname}}; + say {$fh} qq{#}; + say {$fh} qq{################################################################################}; + say {$fh} qq{}; + say {$fh} qq{${brname}_VERSION = ${version}}; + say {$fh} qq{${brname}_SOURCE = ${distname}-\$(${brname}_VERSION).${suffix}}; + say {$fh} qq{${brname}_SITE = \$(BR2_CPAN_MIRROR)${directories}}; + say {$fh} qq{${brname}_DEPENDENCIES = ${dependencies}} if $need_target{$distname} && $dependencies; + say {$fh} qq{HOST_${brname}_DEPENDENCIES = ${host_dependencies}} if $need_host{$distname} && $host_dependencies; + say {$fh} qq{${brname}_LICENSE = ${license}} if $license && $license ne q{unknown}; + say {$fh} qq{${brname}_LICENSE_FILES = ${license_files}} if $license_files; + say {$fh} qq{}; + foreach (sort @{$deps_optional{$distname}}) { + next if grep { $_ eq $distname; } @{$deps_runtime{$_}}; # avoid cyclic dependencies + my $opt_brname = brname( $_ ); + my $opt_fsname = fsname( $_ ); + say {$fh} qq{ifeq (\$(BR2_PACKAGE_PERL_${opt_brname}),y)}; + say {$fh} qq{${brname}_DEPENDENCIES += ${opt_fsname}}; + say {$fh} qq{endif}; + say {$fh} qq{}; + } + say {$fh} qq{\$(eval \$(perl-package))} if $need_target{$distname}; + say {$fh} qq{\$(eval \$(host-perl-package))} if $need_host{$distname}; + close $fh; + } + if ($force || !-f $hashname) { + my ($checksum, $filename) = get_checksum($dist->{download_url}); + my $md5 = $checksum->{md5}; + my $sha256 = $checksum->{sha256}; + say qq{write ${hashname}} unless $quiet; + open my $fh, q{>}, $hashname; + say {$fh} qq{# retrieved by scancpan from ${mirror}/}; + say {$fh} qq{md5 ${md5} ${filename}}; + say {$fh} qq{sha256 ${sha256} ${filename}}; + close $fh; + } +} + +my %pkg; +my $cfgname = q{package/Config.in}; +if (-f $cfgname) { + open my $fh, q{<}, $cfgname; + while (<$fh>) { + chomp; + $pkg{$_} = 1 if m|package/perl-|; + } + close $fh; +} + +foreach my $distname (keys %need_target) { + my $fsname = fsname( $distname ); + $pkg{qq{\tsource "package/${fsname}/Config.in"}} = 1; +} + +say qq{${cfgname} must contain the following lines:}; +say join qq{\n}, sort keys %pkg; + +__END__ + +=head1 NAME + +utils/scancpan Try-Tiny Moo + +=head1 SYNOPSIS + +supports/scripts/scancpan [options] [distname ...] + + Options: + -help + -man + -quiet + -force + -target/-notarget + -host/-nohost + -recommend + -test + +=head1 OPTIONS + +=over 8 + +=item B<-help> + +Prints a brief help message and exits. + +=item B<-man> + +Prints the manual page and exits. + +=item B<-quiet> + +Executes without output + +=item B<-force> + +Forces the overwriting of existing files. + +=item B<-target/-notarget> + +Switches package generation for the target variant (the default is C<-target>). + +=item B<-host/-nohost> + +Switches package generation for the host variant (the default is C<-nohost>). + +=item B<-recommend> + +Adds I dependencies. + +=item B<-test> + +Adds dependencies for test. + +=back + +=head1 DESCRIPTION + +This script creates templates of the Buildroot package files for all the +Perl/CPAN distributions required by the specified distnames. The +dependencies and metadata are fetched from https://metacpan.org/. + +After running this script, it is necessary to check the generated files. +You have to manually add the license files (PERL_FOO_LICENSE_FILES variable). +For distributions that link against a target library, you have to add the +buildroot package name for that library to the DEPENDENCIES variable. + +See the Buildroot documentation for details on the usage of the Perl +infrastructure. + +The major version of the host perl must be aligned on the target one, +in order to work with the right CoreList data. + +=head1 LICENSE + +Copyright (C) 2013-2017 by Francois Perrad + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +This script is a part of Buildroot. + +This script requires the module C (version 1.131730) +which was included at the beginning of this file by the tool C. + +See L. + +See L. + +These both libraries are free software and may be distributed under the same +terms as perl itself. + +And perl may be distributed under the terms of Artistic v1 or GPL v1 license. + +=cut diff --git a/bsp/buildroot/utils/scanpypi b/bsp/buildroot/utils/scanpypi new file mode 100755 index 00000000..cb4b5e76 --- /dev/null +++ b/bsp/buildroot/utils/scanpypi @@ -0,0 +1,706 @@ +#!/usr/bin/env python2 +""" + +Utility for building Buildroot packages for existing PyPI packages + +Any package built by scanpypi should be manually checked for +errors. +""" +from __future__ import print_function +import argparse +import json +import urllib2 +import sys +import os +import shutil +import StringIO +import tarfile +import zipfile +import errno +import hashlib +import re +import textwrap +import tempfile +import imp +from functools import wraps + +BUF_SIZE = 65536 + +try: + import spdx_lookup as liclookup +except ImportError: + # spdx_lookup is not installed + print('spdx_lookup module is not installed. This can lead to an ' + 'inaccurate licence detection. Please install it via\n' + 'pip install spdx_lookup') + liclookup = None + + +def setup_decorator(func, method): + """ + Decorator for distutils.core.setup and setuptools.setup. + Puts the arguments with which setup is called as a dict + Add key 'method' which should be either 'setuptools' or 'distutils'. + + Keyword arguments: + func -- either setuptools.setup or distutils.core.setup + method -- either 'setuptools' or 'distutils' + """ + + @wraps(func) + def closure(*args, **kwargs): + # Any python packages calls its setup function to be installed. + # Argument 'name' of this setup function is the package's name + BuildrootPackage.setup_args[kwargs['name']] = kwargs + BuildrootPackage.setup_args[kwargs['name']]['method'] = method + return closure + +# monkey patch +import setuptools # noqa E402 +setuptools.setup = setup_decorator(setuptools.setup, 'setuptools') +import distutils # noqa E402 +distutils.core.setup = setup_decorator(setuptools.setup, 'distutils') + + +def find_file_upper_case(filenames, path='./'): + """ + List generator: + Recursively find files that matches one of the specified filenames. + Returns a relative path starting with path argument. + + Keyword arguments: + filenames -- List of filenames to be found + path -- Path to the directory to search + """ + for root, dirs, files in os.walk(path): + for file in files: + if file.upper() in filenames: + yield (os.path.join(root, file)) + + +def pkg_buildroot_name(pkg_name): + """ + Returns the Buildroot package name for the PyPI package pkg_name. + Remove all non alphanumeric characters except - + Also lowers the name and adds 'python-' suffix + + Keyword arguments: + pkg_name -- String to rename + """ + name = re.sub('[^\w-]', '', pkg_name.lower()) + prefix = 'python-' + pattern = re.compile('^(?!' + prefix + ')(.+?)$') + name = pattern.sub(r'python-\1', name) + return name + + +class DownloadFailed(Exception): + pass + + +class BuildrootPackage(): + """This class's methods are not meant to be used individually please + use them in the correct order: + + __init__ + + download_package + + extract_package + + load_module + + get_requirements + + create_package_mk + + create_hash_file + + create_config_in + + """ + setup_args = {} + + def __init__(self, real_name, pkg_folder): + self.real_name = real_name + self.buildroot_name = pkg_buildroot_name(self.real_name) + self.pkg_dir = os.path.join(pkg_folder, self.buildroot_name) + self.mk_name = self.buildroot_name.upper().replace('-', '_') + self.as_string = None + self.md5_sum = None + self.metadata = None + self.metadata_name = None + self.metadata_url = None + self.pkg_req = None + self.setup_metadata = None + self.tmp_extract = None + self.used_url = None + self.filename = None + self.url = None + self.version = None + self.license_files = [] + + def fetch_package_info(self): + """ + Fetch a package's metadata from the python package index + """ + self.metadata_url = 'https://pypi.org/pypi/{pkg}/json'.format( + pkg=self.real_name) + try: + pkg_json = urllib2.urlopen(self.metadata_url).read().decode() + except urllib2.HTTPError as error: + print('ERROR:', error.getcode(), error.msg, file=sys.stderr) + print('ERROR: Could not find package {pkg}.\n' + 'Check syntax inside the python package index:\n' + 'https://pypi.python.org/pypi/ ' + .format(pkg=self.real_name)) + raise + except urllib2.URLError: + print('ERROR: Could not find package {pkg}.\n' + 'Check syntax inside the python package index:\n' + 'https://pypi.python.org/pypi/ ' + .format(pkg=self.real_name)) + raise + self.metadata = json.loads(pkg_json) + self.version = self.metadata['info']['version'] + self.metadata_name = self.metadata['info']['name'] + + def download_package(self): + """ + Download a package using metadata from pypi + """ + try: + self.metadata['urls'][0]['filename'] + except IndexError: + print( + 'Non-conventional package, ', + 'please check carefully after creation') + self.metadata['urls'] = [{ + 'packagetype': 'sdist', + 'url': self.metadata['info']['download_url'], + 'digests': None}] + # In this case, we can't get the name of the downloaded file + # from the pypi api, so we need to find it, this should work + urlpath = urllib2.urlparse.urlparse( + self.metadata['info']['download_url']).path + # urlparse().path give something like + # /path/to/file-version.tar.gz + # We use basename to remove /path/to + self.metadata['urls'][0]['filename'] = os.path.basename(urlpath) + for download_url in self.metadata['urls']: + if 'bdist' in download_url['packagetype']: + continue + try: + print('Downloading package {pkg} from {url}...'.format( + pkg=self.real_name, url=download_url['url'])) + download = urllib2.urlopen(download_url['url']) + except urllib2.HTTPError as http_error: + download = http_error + else: + self.used_url = download_url + self.as_string = download.read() + if not download_url['digests']['md5']: + break + self.md5_sum = hashlib.md5(self.as_string).hexdigest() + if self.md5_sum == download_url['digests']['md5']: + break + else: + if download.__class__ == urllib2.HTTPError: + raise download + raise DownloadFailed('Failed to download package {pkg}' + .format(pkg=self.real_name)) + self.filename = self.used_url['filename'] + self.url = self.used_url['url'] + + def extract_package(self, tmp_path): + """ + Extract the package contents into a directrory + + Keyword arguments: + tmp_path -- directory where you want the package to be extracted + """ + as_file = StringIO.StringIO(self.as_string) + if self.filename[-3:] == 'zip': + with zipfile.ZipFile(as_file) as as_zipfile: + tmp_pkg = os.path.join(tmp_path, self.buildroot_name) + try: + os.makedirs(tmp_pkg) + except OSError as exception: + if exception.errno != errno.EEXIST: + print("ERROR: ", exception.strerror, file=sys.stderr) + return + print('WARNING:', exception.strerror, file=sys.stderr) + print('Removing {pkg}...'.format(pkg=tmp_pkg)) + shutil.rmtree(tmp_pkg) + os.makedirs(tmp_pkg) + as_zipfile.extractall(tmp_pkg) + pkg_filename = self.filename.split(".zip")[0] + else: + with tarfile.open(fileobj=as_file) as as_tarfile: + tmp_pkg = os.path.join(tmp_path, self.buildroot_name) + try: + os.makedirs(tmp_pkg) + except OSError as exception: + if exception.errno != errno.EEXIST: + print("ERROR: ", exception.strerror, file=sys.stderr) + return + print('WARNING:', exception.strerror, file=sys.stderr) + print('Removing {pkg}...'.format(pkg=tmp_pkg)) + shutil.rmtree(tmp_pkg) + os.makedirs(tmp_pkg) + as_tarfile.extractall(tmp_pkg) + pkg_filename = self.filename.split(".tar")[0] + + tmp_extract = '{folder}/{name}' + self.tmp_extract = tmp_extract.format( + folder=tmp_pkg, + name=pkg_filename) + + def load_setup(self): + """ + Loads the corresponding setup and store its metadata + """ + current_dir = os.getcwd() + os.chdir(self.tmp_extract) + sys.path.append(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) + 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 + os.chdir(current_dir) + sys.path.remove(self.tmp_extract) + + def get_requirements(self, pkg_folder): + """ + Retrieve dependencies from the metadata found in the setup.py script of + a pypi package. + + Keyword Arguments: + pkg_folder -- location of the already created packages + """ + if 'install_requires' not in self.setup_metadata: + self.pkg_req = None + return set() + self.pkg_req = self.setup_metadata['install_requires'] + self.pkg_req = [re.sub('([-.\w]+).*', r'\1', req) + for req in self.pkg_req] + + # get rid of commented lines and also strip the package strings + self.pkg_req = [item.strip() for item in self.pkg_req + if len(item) > 0 and item[0] != '#'] + + req_not_found = self.pkg_req + self.pkg_req = map(pkg_buildroot_name, self.pkg_req) + pkg_tuples = zip(req_not_found, self.pkg_req) + # pkg_tuples is a list of tuples that looks like + # ('werkzeug','python-werkzeug') because I need both when checking if + # dependencies already exist or are already in the download list + req_not_found = set( + pkg[0] for pkg in pkg_tuples + if not os.path.isdir(pkg[1]) + ) + return req_not_found + + def __create_mk_header(self): + """ + Create the header of the .mk file + """ + header = ['#' * 80 + '\n'] + header.append('#\n') + header.append('# {name}\n'.format(name=self.buildroot_name)) + header.append('#\n') + header.append('#' * 80 + '\n') + header.append('\n') + return header + + def __create_mk_download_info(self): + """ + Create the lines refering to the download information of the + .mk file + """ + lines = [] + version_line = '{name}_VERSION = {version}\n'.format( + name=self.mk_name, + version=self.version) + lines.append(version_line) + + targz = self.filename.replace( + self.version, + '$({name}_VERSION)'.format(name=self.mk_name)) + targz_line = '{name}_SOURCE = {filename}\n'.format( + name=self.mk_name, + filename=targz) + lines.append(targz_line) + + if self.filename not in self.url: + # Sometimes the filename is in the url, sometimes it's not + site_url = self.url + else: + site_url = self.url[:self.url.find(self.filename)] + site_line = '{name}_SITE = {url}'.format(name=self.mk_name, + url=site_url) + site_line = site_line.rstrip('/') + '\n' + lines.append(site_line) + return lines + + def __create_mk_setup(self): + """ + Create the line refering to the setup method of the package of the + .mk file + + There are two things you can use to make an installer + for a python package: distutils or setuptools + distutils comes with python but does not support dependencies. + distutils is mostly still there for backward support. + setuptools is what smart people use, + but it is not shipped with python :( + """ + lines = [] + setup_type_line = '{name}_SETUP_TYPE = {method}\n'.format( + name=self.mk_name, + method=self.setup_metadata['method']) + lines.append(setup_type_line) + return lines + + def __get_license_names(self, license_files): + """ + Try to determine the related license name. + + There are two possibilities. Either the script tries to + get license name from package's metadata or, if spdx_lookup + package is available, the script compares license files with + SPDX database. + """ + license_line = '' + if liclookup is None: + license_dict = { + 'Apache Software License': 'Apache-2.0', + 'BSD License': 'FIXME: please specify the exact BSD version', + 'European Union Public Licence 1.0': 'EUPL-1.0', + 'European Union Public Licence 1.1': 'EUPL-1.1', + "GNU General Public License": "GPL", + "GNU General Public License v2": "GPL-2.0", + "GNU General Public License v2 or later": "GPL-2.0+", + "GNU General Public License v3": "GPL-3.0", + "GNU General Public License v3 or later": "GPL-3.0+", + "GNU Lesser General Public License v2": "LGPL-2.1", + "GNU Lesser General Public License v2 or later": "LGPL-2.1+", + "GNU Lesser General Public License v3": "LGPL-3.0", + "GNU Lesser General Public License v3 or later": "LGPL-3.0+", + "GNU Library or Lesser General Public License": "LGPL-2.0", + "ISC License": "ISC", + "MIT License": "MIT", + "Mozilla Public License 1.0": "MPL-1.0", + "Mozilla Public License 1.1": "MPL-1.1", + "Mozilla Public License 2.0": "MPL-2.0", + "Zope Public License": "ZPL" + } + regexp = re.compile('^License :* *.* *:+ (.*)( \(.*\))?$') + classifiers_licenses = [regexp.sub(r"\1", lic) + for lic in self.metadata['info']['classifiers'] + if regexp.match(lic)] + licenses = map(lambda x: license_dict[x] if x in license_dict else x, + classifiers_licenses) + if not len(licenses): + print('WARNING: License has been set to "{license}". It is most' + ' likely wrong, please change it if need be'.format( + license=', '.join(licenses))) + licenses = [self.metadata['info']['license']] + license_line = '{name}_LICENSE = {license}\n'.format( + name=self.mk_name, + license=', '.join(licenses)) + else: + license_names = [] + for license_file in license_files: + with open(license_file) as lic_file: + match = liclookup.match(lic_file.read()) + if match.confidence >= 90.0: + license_names.append(match.license.id) + + if len(license_names) > 0: + license_line = ('{name}_LICENSE =' + ' {names}\n'.format( + name=self.mk_name, + names=', '.join(license_names))) + + return license_line + + def __create_mk_license(self): + """ + Create the lines referring to the package's license informations of the + .mk file + + The license's files are found by searching the package (case insensitive) + for files named license, license.txt etc. If more than one license file + is found, the user is asked to select which ones he wants to use. + """ + lines = [] + + filenames = ['LICENCE', 'LICENSE', '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)) + + license_files = [license.replace(self.tmp_extract, '')[1:] + for license in self.license_files] + if len(license_files) > 0: + if len(license_files) > 1: + print('More than one file found for license:', + ', '.join(license_files)) + license_files = [filename + for index, filename in enumerate(license_files)] + license_file_line = ('{name}_LICENSE_FILES =' + ' {files}\n'.format( + name=self.mk_name, + files=' '.join(license_files))) + lines.append(license_file_line) + else: + print('WARNING: No license file found,' + ' please specify it manually afterwards') + license_file_line = '# No license file found\n' + + return lines + + def __create_mk_requirements(self): + """ + Create the lines referring to the dependencies of the of the + .mk file + + Keyword Arguments: + pkg_name -- name of the package + pkg_req -- dependencies of the package + """ + lines = [] + dependencies_line = ('{name}_DEPENDENCIES =' + ' {reqs}\n'.format( + name=self.mk_name, + reqs=' '.join(self.pkg_req))) + lines.append(dependencies_line) + return lines + + def create_package_mk(self): + """ + Create the lines corresponding to the .mk file + """ + pkg_mk = '{name}.mk'.format(name=self.buildroot_name) + path_to_mk = os.path.join(self.pkg_dir, pkg_mk) + print('Creating {file}...'.format(file=path_to_mk)) + lines = self.__create_mk_header() + lines += self.__create_mk_download_info() + lines += self.__create_mk_setup() + lines += self.__create_mk_license() + + lines.append('\n') + lines.append('$(eval $(python-package))') + lines.append('\n') + with open(path_to_mk, 'w') as mk_file: + mk_file.writelines(lines) + + def create_hash_file(self): + """ + Create the lines corresponding to the .hash files + """ + pkg_hash = '{name}.hash'.format(name=self.buildroot_name) + path_to_hash = os.path.join(self.pkg_dir, pkg_hash) + print('Creating {filename}...'.format(filename=path_to_hash)) + lines = [] + if self.used_url['digests']['md5'] and self.used_url['digests']['sha256']: + hash_header = '# md5, sha256 from {url}\n'.format( + url=self.metadata_url) + lines.append(hash_header) + hash_line = '{method}\t{digest} {filename}\n'.format( + method='md5', + digest=self.used_url['digests']['md5'], + filename=self.filename) + lines.append(hash_line) + hash_line = '{method}\t{digest} {filename}\n'.format( + method='sha256', + digest=self.used_url['digests']['sha256'], + filename=self.filename) + lines.append(hash_line) + + if self.license_files: + lines.append('# Locally computed sha256 checksums\n') + for license_file in self.license_files: + sha256 = hashlib.sha256() + with open(license_file, 'rb') as lic_f: + while True: + data = lic_f.read(BUF_SIZE) + if not data: + break + sha256.update(data) + hash_line = '{method}\t{digest} {filename}\n'.format( + method='sha256', + digest=sha256.hexdigest(), + filename=os.path.basename(license_file)) + lines.append(hash_line) + + with open(path_to_hash, 'w') as hash_file: + hash_file.writelines(lines) + + def create_config_in(self): + """ + Creates the Config.in file of a package + """ + path_to_config = os.path.join(self.pkg_dir, 'Config.in') + print('Creating {file}...'.format(file=path_to_config)) + lines = [] + config_line = 'config BR2_PACKAGE_{name}\n'.format( + name=self.mk_name) + lines.append(config_line) + + bool_line = '\tbool "{name}"\n'.format(name=self.buildroot_name) + lines.append(bool_line) + if self.pkg_req: + for dep in self.pkg_req: + dep_line = '\tselect BR2_PACKAGE_{req} # runtime\n'.format( + req=dep.upper().replace('-', '_')) + lines.append(dep_line) + + lines.append('\thelp\n') + + help_lines = textwrap.wrap(self.metadata['info']['summary'], + initial_indent='\t ', + subsequent_indent='\t ') + + # make sure a help text is terminated with a full stop + if help_lines[-1][-1] != '.': + help_lines[-1] += '.' + + # \t + two spaces is 3 char long + help_lines.append('') + help_lines.append('\t ' + self.metadata['info']['home_page']) + help_lines = map(lambda x: x + '\n', help_lines) + lines += help_lines + + with open(path_to_config, 'w') as config_file: + config_file.writelines(lines) + + +def main(): + # Building the parser + parser = argparse.ArgumentParser( + description="Creates buildroot packages from the metadata of " + "an existing PyPI packages and include it " + "in menuconfig") + parser.add_argument("packages", + help="list of packages to be created", + nargs='+') + parser.add_argument("-o", "--output", + help=""" + Output directory for packages. + Default is ./package + """, + default='./package') + + args = parser.parse_args() + packages = list(set(args.packages)) + + # tmp_path is where we'll extract the files later + tmp_prefix = 'scanpypi-' + pkg_folder = args.output + tmp_path = tempfile.mkdtemp(prefix=tmp_prefix) + try: + for real_pkg_name in packages: + package = BuildrootPackage(real_pkg_name, pkg_folder) + print('buildroot package name for {}:'.format(package.real_name), + package.buildroot_name) + # First we download the package + # Most of the info we need can only be found inside the package + print('Package:', package.buildroot_name) + print('Fetching package', package.real_name) + try: + package.fetch_package_info() + except (urllib2.URLError, urllib2.HTTPError): + continue + if package.metadata_name.lower() == 'setuptools': + # setuptools imports itself, that does not work very well + # with the monkey path at the begining + print('Error: setuptools cannot be built using scanPyPI') + continue + + try: + package.download_package() + except urllib2.HTTPError as error: + print('Error: {code} {reason}'.format(code=error.code, + reason=error.reason)) + print('Error downloading package :', package.buildroot_name) + print() + continue + + # extract the tarball + try: + package.extract_package(tmp_path) + except (tarfile.ReadError, zipfile.BadZipfile): + print('Error extracting package {}'.format(package.real_name)) + print() + continue + + # Loading the package install info from the package + try: + package.load_setup() + except ImportError as err: + if 'buildutils' in err.message: + print('This package needs buildutils') + else: + raise + continue + except AttributeError as error: + print('Error: Could not install package {pkg}: {error}'.format( + pkg=package.real_name, error=error)) + continue + + # Package requirement are an argument of the setup function + req_not_found = package.get_requirements(pkg_folder) + req_not_found = req_not_found.difference(packages) + + packages += req_not_found + if req_not_found: + print('Added packages \'{pkgs}\' as dependencies of {pkg}' + .format(pkgs=", ".join(req_not_found), + pkg=package.buildroot_name)) + print('Checking if package {name} already exists...'.format( + name=package.pkg_dir)) + try: + os.makedirs(package.pkg_dir) + except OSError as exception: + if exception.errno != errno.EEXIST: + print("ERROR: ", exception.message, file=sys.stderr) + continue + print('Error: Package {name} already exists' + .format(name=package.pkg_dir)) + del_pkg = raw_input( + 'Do you want to delete existing package ? [y/N]') + if del_pkg.lower() == 'y': + shutil.rmtree(package.pkg_dir) + os.makedirs(package.pkg_dir) + else: + continue + package.create_package_mk() + + package.create_hash_file() + + package.create_config_in() + print() + # printing an empty line for visual confort + finally: + shutil.rmtree(tmp_path) + + +if __name__ == "__main__": + main() diff --git a/bsp/buildroot/utils/size-stats-compare b/bsp/buildroot/utils/size-stats-compare new file mode 100755 index 00000000..e5a1ec3f --- /dev/null +++ b/bsp/buildroot/utils/size-stats-compare @@ -0,0 +1,127 @@ +#!/usr/bin/env python + +# Copyright (C) 2016 Thomas De Schampheleire + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +# TODO (improvements) +# - support K,M,G size suffixes for threshold +# - output CSV file in addition to stdout reporting + +import csv +import argparse +import sys + +def read_file_size_csv(inputf, detail=None): + """Extract package or file sizes from CSV file into size dictionary""" + sizes = {} + reader = csv.reader(inputf) + + header = next(reader) + if (header[0] != 'File name' or header[1] != 'Package name' or + header[2] != 'File size' or header[3] != 'Package size'): + print(("Input file %s does not contain the expected header. Are you " + "sure this file corresponds to the file-size-stats.csv " + "file created by 'make graph-size'?") % inputf.name) + sys.exit(1) + + for row in reader: + if detail: + sizes[row[0]] = int(row[2]) + else: + sizes[row[1]] = int(row[3]) + + return sizes + +def compare_sizes(old, new): + """Return delta/added/removed dictionaries based on two input size + dictionaries""" + delta = {} + oldkeys = set(old.keys()) + newkeys = set(new.keys()) + + # packages/files in both + for entry in newkeys.intersection(oldkeys): + delta[entry] = ('', new[entry] - old[entry]) + # packages/files only in new + for entry in newkeys.difference(oldkeys): + delta[entry] = ('added', new[entry]) + # packages/files only in old + for entry in oldkeys.difference(newkeys): + delta[entry] = ('removed', -old[entry]) + + return delta + +def print_results(result, threshold): + """Print the given result dictionary sorted by size, ignoring any entries + below or equal to threshold""" + + from six import iteritems + list_result = list(iteritems(result)) + # result is a dictionary: name -> (flag, size difference) + # list_result is a list of tuples: (name, (flag, size difference)) + + for entry in sorted(list_result, key=lambda entry: entry[1][1]): + if threshold is not None and abs(entry[1][1]) <= threshold: + continue + print('%12s %7s %s' % (entry[1][1], entry[1][0], entry[0])) + + +# main ######################################################################### + +description = """ +Compare rootfs size between Buildroot compilations, for example after changing +configuration options or after switching to another Buildroot release. + +This script compares the file-size-stats.csv file generated by 'make graph-size' +with the corresponding file from another Buildroot compilation. +The size differences can be reported per package or per file. +Size differences smaller or equal than a given threshold can be ignored. +""" + +parser = argparse.ArgumentParser(description=description, + formatter_class=argparse.RawDescriptionHelpFormatter) + +parser.add_argument('-d', '--detail', action='store_true', + help='''report differences for individual files rather than + packages''') +parser.add_argument('-t', '--threshold', type=int, + help='''ignore size differences smaller or equal than this + value (bytes)''') +parser.add_argument('old_file_size_csv', type=argparse.FileType('r'), + metavar='old-file-size-stats.csv', + help="""old CSV file with file and package size statistics, + generated by 'make graph-size'""") +parser.add_argument('new_file_size_csv', type=argparse.FileType('r'), + metavar='new-file-size-stats.csv', + help='new CSV file with file and package size statistics') +args = parser.parse_args() + +if args.detail: + keyword = 'file' +else: + keyword = 'package' + +old_sizes = read_file_size_csv(args.old_file_size_csv, args.detail) +new_sizes = read_file_size_csv(args.new_file_size_csv, args.detail) + +delta = compare_sizes(old_sizes, new_sizes) + +print('Size difference per %s (bytes), threshold = %s' % (keyword, args.threshold)) +print(80*'-') +print_results(delta, args.threshold) +print(80*'-') +print_results({'TOTAL': ('', sum(new_sizes.values()) - sum(old_sizes.values()))}, + threshold=None) diff --git a/bsp/buildroot/utils/test-pkg b/bsp/buildroot/utils/test-pkg new file mode 100755 index 00000000..17d3756d --- /dev/null +++ b/bsp/buildroot/utils/test-pkg @@ -0,0 +1,195 @@ +#!/usr/bin/env bash +set -e + +TOOLCHAINS_CSV='support/config-fragments/autobuild/toolchain-configs.csv' + +main() { + local o O opts + local cfg dir pkg random toolchains_dir toolchain + local ret nb nb_skip nb_fail nb_legal nb_tc build_dir + local -a toolchains + + o='hc:d:p:r:t:' + O='help,config-snippet:build-dir:package:,random:,toolchains-dir:' + opts="$(getopt -n "${my_name}" -o "${o}" -l "${O}" -- "${@}")" + eval set -- "${opts}" + + random=0 + toolchains_csv="${TOOLCHAINS_CSV}" + while [ ${#} -gt 0 ]; do + case "${1}" in + (-h|--help) + help; exit 0 + ;; + (-c|--config-snippet) + cfg="${2}"; shift 2 + ;; + (-d|--build-dir) + dir="${2}"; shift 2 + ;; + (-p|--package) + pkg="${2}"; shift 2 + ;; + (-r|--random) + random="${2}"; shift 2 + ;; + (-t|--toolchains-csv) + toolchains_csv="${2}"; shift 2 + ;; + (--) + shift; break + ;; + esac + done + if [ -z "${cfg}" ]; then + printf "error: no config snippet specified\n" >&2; exit 1 + fi + if [ ! -e "${cfg}" ]; then + printf "error: %s: no such file\n" "${cfg}" >&2; exit 1 + fi + if [ -z "${dir}" ]; then + dir="${HOME}/br-test-pkg" + fi + + # Extract the URLs of the toolchains; drop internal toolchains + # E.g.: http://server/path/to/name.config,arch,libc + # --> http://server/path/to/name.config + toolchains=($(sed -r -e 's/,.*//; /internal/d; /^#/d; /^$/d;' "${toolchains_csv}" \ + |if [ ${random} -gt 0 ]; then \ + sort -R |head -n ${random} + else + cat + fi |sort + ) + ) + + nb_tc="${#toolchains[@]}" + if [ ${nb_tc} -eq 0 ]; then + printf "error: no toolchain found (networking issue?)\n" >&2; exit 1 + fi + + nb=0 + nb_skip=0 + nb_fail=0 + nb_legal=0 + for toolchainconfig in "${toolchains[@]}"; do + : $((nb++)) + toolchain="$(basename "${toolchainconfig}" .config)" + build_dir="${dir}/${toolchain}" + printf "%40s [%*d/%d]: " "${toolchain}" ${#nb_tc} ${nb} ${nb_tc} + build_one "${build_dir}" "${toolchainconfig}" "${cfg}" "${pkg}" && ret=0 || ret=${?} + case ${ret} in + (0) printf "OK\n";; + (1) : $((nb_skip++)); printf "SKIPPED\n";; + (2) : $((nb_fail++)); printf "FAILED\n";; + (3) : $((nb_legal++)); printf "FAILED\n";; + esac + done + + printf "%d builds, %d skipped, %d build failed, %d legal-info failed\n" \ + ${nb} ${nb_skip} ${nb_fail} ${nb_legal} +} + +build_one() { + local dir="${1}" + local toolchainconfig="${2}" + local cfg="${3}" + local pkg="${4}" + + mkdir -p "${dir}" + + support/kconfig/merge_config.sh -O "${dir}" \ + "${toolchainconfig}" "support/config-fragments/minimal.config" "${cfg}" \ + >> "${dir}/logfile" 2>&1 + # We want all the options from the snippet to be present as-is (set + # or not set) in the actual .config; if one of them is not, it means + # some dependency from the toolchain or arch is not available, in + # which case this config is untestable and we skip it. + # We don't care about the locale to sort in, as long as both sort are + # done in the same locale. + comm -23 <(sort "${cfg}") <(sort "${dir}/.config") >"${dir}/missing.config" + if [ -s "${dir}/missing.config" ]; then + return 1 + fi + # Remove file, it's empty anyway. + rm -f "${dir}/missing.config" + + if [ -n "${pkg}" ]; then + if ! make O="${dir}" "${pkg}-dirclean" >> "${dir}/logfile" 2>&1; then + return 2 + fi + fi + + # shellcheck disable=SC2086 + if ! make O="${dir}" ${pkg} >> "${dir}/logfile" 2>&1; then + return 2 + fi + + # legal-info done systematically, because some packages have different + # sources depending on the configuration (e.g. lua-5.2 vs. lua-5.3) + if ! make O="${dir}" legal-info >> "${dir}/logfile" 2>&1; then + return 3 + fi +} + +help() { + cat <<_EOF_ +test-pkg: test-build a package against various toolchains and architectures + +The supplied config snippet is appended to each toolchain config, the +resulting configuration is checked to ensure it still contains all options +specified in the snippet; if any is missing, the build is skipped, on the +assumption that the package under test requires a toolchain or architecture +feature that is missing. + +In case failures are noticed, you can fix the package and just re-run the +same command again; it will re-run the test where it failed. If you did +specify a package (with -p), the package build dir will be removed first. + +The list of toolchains is retrieved from ${TOOLCHAINS_CSV}. +Only the external toolchains are tried, because building a Buildroot toolchain +would take too long. An alternative toolchains CSV file can be specified with +the -t option. This file should have lines consisting of the path to the +toolchain config fragment and the required host architecture, separated by a +comma. The config fragments should contain only the toolchain and architecture +settings. + +Options: + + -h, --help + Print this help. + + -c CFG, --config-snippet CFG + Use the CFG file as the source for the config snippet. This file + should contain all the config options required to build a package. + + -d DIR, --build-dir DIR + Do the builds in directory DIR, one sub-dir per toolchain. + + -p PKG, --package PKG + Test-build the package PKG, by running 'make PKG'; if not specified, + just runs 'make'. + + -r N, --random N + Limit the tests to the N randomly selected toolchains, instead of + building with all toolchains. + + -t CSVFILE, --toolchains-csv CSVFILE + CSV file containing the paths to config fragments of toolchains to + try. If not specified, the toolchains in ${TOOLCHAINS_CSV} will be + used. + +Example: + + Testing libcec would require a config snippet that contains: + BR2_PACKAGE_LIBCEC=y + + Testing libcurl with openSSL support would require a snippet such as: + BR2_PACKAGE_OPENSSL=y + BR2_PACKAGE_LIBCURL=y + +_EOF_ +} + +my_name="${0##*/}" +main "${@}"