From aaac5851ea7388462ea080f2a0985916247dc4cb Mon Sep 17 00:00:00 2001 From: CN_SZTL Date: Tue, 3 Dec 2019 18:36:22 +0800 Subject: [PATCH] toolchain: sync source --- toolchain/Config.in | 9 +++---- toolchain/glibc/common.mk | 4 +-- .../patches/001-regex-read-overrun.patch | 26 +++++++++++++++++++ toolchain/kernel-headers/Makefile | 8 +++--- toolchain/musl/common.mk | 2 +- 5 files changed, 36 insertions(+), 13 deletions(-) create mode 100644 toolchain/glibc/patches/001-regex-read-overrun.patch diff --git a/toolchain/Config.in b/toolchain/Config.in index 95087b7078..762f4e10d7 100644 --- a/toolchain/Config.in +++ b/toolchain/Config.in @@ -238,7 +238,6 @@ comment "C Library" choice prompt "C Library implementation" if TOOLCHAINOPTS default LIBC_USE_UCLIBC if arc - default LIBC_USE_GLIBC if powerpc64 default LIBC_USE_MUSL help Select the C library implementation. @@ -251,13 +250,12 @@ choice config LIBC_USE_UCLIBC select USE_UCLIBC bool "Use uClibc" - depends on !(aarch64 || aarch64_be || powerpc64) - depends on BROKEN || !(arm || armeb || i386 || x86_64 || mips || mipsel || mips64 || mips64el || powerpc) + depends on BROKEN || arc config LIBC_USE_MUSL select USE_MUSL bool "Use musl" - depends on !(arc || powerpc64) + depends on !arc endchoice @@ -275,7 +273,6 @@ config GDB Enable if you want to build the gdb. config USE_GLIBC - default y if !TOOLCHAINOPTS && !EXTERNAL_TOOLCHAIN && !NATIVE_TOOLCHAIN && (powerpc64) bool config USE_UCLIBC @@ -283,7 +280,7 @@ config USE_UCLIBC bool config USE_MUSL - default y if !TOOLCHAINOPTS && !EXTERNAL_TOOLCHAIN && !NATIVE_TOOLCHAIN && !(arc || powerpc64) + default y if !TOOLCHAINOPTS && !EXTERNAL_TOOLCHAIN && !NATIVE_TOOLCHAIN && !(arc) bool config SSP_SUPPORT diff --git a/toolchain/glibc/common.mk b/toolchain/glibc/common.mk index cdc5f20bf6..ef182e4475 100644 --- a/toolchain/glibc/common.mk +++ b/toolchain/glibc/common.mk @@ -11,8 +11,8 @@ PKG_VERSION:=2.27 PKG_SOURCE_PROTO:=git PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION) -PKG_SOURCE_VERSION:=54ba8bcd42355ad0c0ca763b6bba40a2b2829f38 -PKG_MIRROR_HASH:=88d2672e0ac4192b6c28378b85bf3bcaec404f448bef418c790cd9f830012a3f +PKG_SOURCE_VERSION:=5b4f7382af46b4187a958e40fb3123ac3ce16810 +PKG_MIRROR_HASH:=8ab4c8c1f769c4d5d482c30e7aa029f1cc2c8163c347ca5f0d8224a7b4b61ddd PKG_SOURCE_URL:=https://sourceware.org/git/glibc.git PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.xz diff --git a/toolchain/glibc/patches/001-regex-read-overrun.patch b/toolchain/glibc/patches/001-regex-read-overrun.patch new file mode 100644 index 0000000000..c4e4307aa6 --- /dev/null +++ b/toolchain/glibc/patches/001-regex-read-overrun.patch @@ -0,0 +1,26 @@ +commit 583dd860d5b833037175247230a328f0050dbfe9 +Author: Paul Eggert +Date: Mon Jan 21 11:08:13 2019 -0800 + + regex: fix read overrun [BZ #24114] + + Problem found by AddressSanitizer, reported by Hongxu Chen in: + https://debbugs.gnu.org/34140 + * posix/regexec.c (proceed_next_node): + Do not read past end of input buffer. + +--- a/posix/regexec.c ++++ b/posix/regexec.c +@@ -1293,8 +1293,10 @@ proceed_next_node (const re_match_context_t *mctx, Idx nregs, regmatch_t *regs, + else if (naccepted) + { + char *buf = (char *) re_string_get_buffer (&mctx->input); +- if (memcmp (buf + regs[subexp_idx].rm_so, buf + *pidx, +- naccepted) != 0) ++ if (mctx->input.valid_len - *pidx < naccepted ++ || (memcmp (buf + regs[subexp_idx].rm_so, buf + *pidx, ++ naccepted) ++ != 0)) + return -1; + } + } diff --git a/toolchain/kernel-headers/Makefile b/toolchain/kernel-headers/Makefile index f7842cb9bd..a4120d587d 100644 --- a/toolchain/kernel-headers/Makefile +++ b/toolchain/kernel-headers/Makefile @@ -41,14 +41,14 @@ HOST_EXTRACFLAGS= LINUX_HAS_HEADERS_INSTALL:=y -KMAKE := $(MAKE) -C $(HOST_BUILD_DIR) \ +HOST_KMAKE := $(MAKE) -C $(HOST_BUILD_DIR) \ $(KERNEL_MAKE_FLAGS) \ CC="$(KERNEL_CC)" \ - CFLAGS="$(TARGET_CFLAGS)" + HOSTCFLAGS="$(HOST_CFLAGS)" define Host/Configure/all mkdir -p $(BUILD_DIR_TOOLCHAIN)/linux-dev - $(KMAKE) \ + $(HOST_KMAKE) \ INSTALL_HDR_PATH="$(BUILD_DIR_TOOLCHAIN)/linux-dev/" \ headers_install endef @@ -82,7 +82,7 @@ endef define Host/Configure env - yes '' | $(KMAKE) oldconfig + yes '' | $(HOST_KMAKE) oldconfig $(call Host/Configure/all) $(call Host/Configure/post/$(ARCH)) endef diff --git a/toolchain/musl/common.mk b/toolchain/musl/common.mk index bb9d9a75a5..e1354f2635 100644 --- a/toolchain/musl/common.mk +++ b/toolchain/musl/common.mk @@ -15,7 +15,7 @@ PKG_SOURCE_PROTO:=git PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION) PKG_SOURCE_VERSION:=ea9525c8bcf6170df59364c4bcd616de1acf8703 PKG_MIRROR_HASH:=6975c45b9bfe586ac00dbfcd1b1a13ab110af0528028ab3dee03e23e2c0763e5 -PKG_SOURCE_URL:=git://git.musl-libc.org/musl +PKG_SOURCE_URL:=https://git.musl-libc.org/git/musl PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.xz LIBC_SO_VERSION:=$(PKG_VERSION)