From patchwork Sun Jan 31 22:32:59 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Petazzoni X-Patchwork-Id: 1433964 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=busybox.net (client-ip=140.211.166.137; helo=fraxinus.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4DTQp42vBMz9sWw for ; Mon, 1 Feb 2021 09:33:16 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 077C185540; Sun, 31 Jan 2021 22:33:15 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 23YO0_RCyqaN; Sun, 31 Jan 2021 22:33:14 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by fraxinus.osuosl.org (Postfix) with ESMTP id 6D61185754; Sun, 31 Jan 2021 22:33:14 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) by ash.osuosl.org (Postfix) with ESMTP id DA7321BF95A for ; Sun, 31 Jan 2021 22:33:12 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id D71C285540 for ; Sun, 31 Jan 2021 22:33:12 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 7-BjmrM4a6cC for ; Sun, 31 Jan 2021 22:33:12 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from relay8-d.mail.gandi.net (relay8-d.mail.gandi.net [217.70.183.201]) by fraxinus.osuosl.org (Postfix) with ESMTPS id A1A5685623 for ; Sun, 31 Jan 2021 22:33:11 +0000 (UTC) X-Originating-IP: 185.200.12.8 Received: from localhost (unknown [185.200.12.8]) (Authenticated sender: thomas.petazzoni@bootlin.com) by relay8-d.mail.gandi.net (Postfix) with ESMTPSA id E4F571BF207; Sun, 31 Jan 2021 22:33:09 +0000 (UTC) From: Thomas Petazzoni To: Buildroot List Date: Sun, 31 Jan 2021 23:32:59 +0100 Message-Id: <20210131223304.1857838-1-thomas.petazzoni@bootlin.com> X-Mailer: git-send-email 2.29.2 MIME-Version: 1.0 Subject: [Buildroot] [PATCH 1/5] package/binutils: bump 2.35.x series to 2.35.2 X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Romain Naour , Thomas Petazzoni Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" Release notes: https://sourceware.org/pipermail/binutils/2021-January/115150.html Signed-off-by: Thomas Petazzoni --- package/binutils/{2.35.1 => 2.35.2}/0001-sh-conf.patch | 0 .../{2.35.1 => 2.35.2}/0002-poison-system-directories.patch | 0 package/binutils/Config.in.host | 4 ++-- package/binutils/binutils.hash | 2 +- 4 files changed, 3 insertions(+), 3 deletions(-) rename package/binutils/{2.35.1 => 2.35.2}/0001-sh-conf.patch (100%) rename package/binutils/{2.35.1 => 2.35.2}/0002-poison-system-directories.patch (100%) diff --git a/package/binutils/2.35.1/0001-sh-conf.patch b/package/binutils/2.35.2/0001-sh-conf.patch similarity index 100% rename from package/binutils/2.35.1/0001-sh-conf.patch rename to package/binutils/2.35.2/0001-sh-conf.patch diff --git a/package/binutils/2.35.1/0002-poison-system-directories.patch b/package/binutils/2.35.2/0002-poison-system-directories.patch similarity index 100% rename from package/binutils/2.35.1/0002-poison-system-directories.patch rename to package/binutils/2.35.2/0002-poison-system-directories.patch diff --git a/package/binutils/Config.in.host b/package/binutils/Config.in.host index 89c6894a1f..49daf3b70a 100644 --- a/package/binutils/Config.in.host +++ b/package/binutils/Config.in.host @@ -32,7 +32,7 @@ config BR2_BINUTILS_VERSION_2_34_X depends on !BR2_BINFMT_FLAT config BR2_BINUTILS_VERSION_2_35_X - bool "binutils 2.35.1" + bool "binutils 2.35.2" depends on !BR2_csky # https://github.com/uclinux-dev/elf2flt/pull/16 # https://github.com/uclinux-dev/elf2flt/issues/12 @@ -55,7 +55,7 @@ config BR2_BINUTILS_VERSION default "2.32" if BR2_BINUTILS_VERSION_2_32_X default "2.33.1" if BR2_BINUTILS_VERSION_2_33_X default "2.34" if BR2_BINUTILS_VERSION_2_34_X - default "2.35.1" if BR2_BINUTILS_VERSION_2_35_X + default "2.35.2" if BR2_BINUTILS_VERSION_2_35_X config BR2_BINUTILS_ENABLE_LTO bool diff --git a/package/binutils/binutils.hash b/package/binutils/binutils.hash index ce5b0cdca8..ff91e802cc 100644 --- a/package/binutils/binutils.hash +++ b/package/binutils/binutils.hash @@ -2,7 +2,7 @@ sha512 d326408f12a03d9a61a9de56584c2af12f81c2e50d2d7e835d51565df8314df01575724afa1e43bd0db45cfc9916b41519b67dfce03232aa4978704492a6994a binutils-2.32.tar.xz sha512 b7a6767c6c7ca6b5cafa7080e6820b7bb3a53b7148348c438d99905defbdf0d30c9744a484ee01c9441a8153901808513366b15ba9533e20c9673c262ade36ac binutils-2.33.1.tar.xz sha512 2c7976939dcf5e8c5b7374cccd39bfe803b1bec73c6abfa0eb17c24e1942574c6bdb874c66a092a82adc443182eacd8a5a8001c19a76101f0c7ba40c27de0bbd binutils-2.34.tar.xz -sha512 94ff72708403413b70b247f3af4099ebaa882b6659249869f1ed9941a0f1912e313f08357d470f9fd2359e7f5e5b0eb86285e5eaf883fa8187789d6b1bd304eb binutils-2.35.1.tar.xz +sha512 9974ede5978d32e0d68fef23da48fa00bd06b0bff7ec45b00ca075c126d6bbe0cf2defc03ecc3f17bc6cc85b64271a13009c4049d7ba17de26e84e3a6e2c0348 binutils-2.35.2.tar.xz # Locally calculated (fetched from Github) sha512 76a8227a19218435319c660e4983ea17985194b7f496f163e97543e7f6fd3e9249241fdc05a16ba512fba96a1d846c1f7b080983404d821d6215f10e7f11e238 binutils-gdb-arc-2020.09-release.tar.gz From patchwork Sun Jan 31 22:33:00 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Petazzoni X-Patchwork-Id: 1433966 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=busybox.net (client-ip=140.211.166.137; helo=fraxinus.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4DTQpF31Cqz9sWw for ; Mon, 1 Feb 2021 09:33:25 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id C4E92858DA; Sun, 31 Jan 2021 22:33:23 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id nS45kZyXvMuK; Sun, 31 Jan 2021 22:33:22 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by fraxinus.osuosl.org (Postfix) with ESMTP id 084EA85797; Sun, 31 Jan 2021 22:33:22 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) by ash.osuosl.org (Postfix) with ESMTP id CB9011BF395 for ; Sun, 31 Jan 2021 22:33:17 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id C36D986777 for ; Sun, 31 Jan 2021 22:33:17 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id ESTXGNnk20fC for ; Sun, 31 Jan 2021 22:33:15 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from relay9-d.mail.gandi.net (relay9-d.mail.gandi.net [217.70.183.199]) by whitealder.osuosl.org (Postfix) with ESMTPS id 2415686762 for ; Sun, 31 Jan 2021 22:33:14 +0000 (UTC) X-Originating-IP: 185.200.12.8 Received: from localhost (unknown [185.200.12.8]) (Authenticated sender: thomas.petazzoni@bootlin.com) by relay9-d.mail.gandi.net (Postfix) with ESMTPSA id 5A1AFFF803; Sun, 31 Jan 2021 22:33:11 +0000 (UTC) From: Thomas Petazzoni To: Buildroot List Date: Sun, 31 Jan 2021 23:33:00 +0100 Message-Id: <20210131223304.1857838-2-thomas.petazzoni@bootlin.com> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210131223304.1857838-1-thomas.petazzoni@bootlin.com> References: <20210131223304.1857838-1-thomas.petazzoni@bootlin.com> MIME-Version: 1.0 Subject: [Buildroot] [PATCH 2/5] package/binutils: add support for version 2.36 X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Romain Naour , Thomas Petazzoni Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" Release e-mail: https://sourceware.org/pipermail/binutils/2021-January/115071.html Signed-off-by: Thomas Petazzoni --- package/binutils/2.36/0001-sh-conf.patch | 48 +++ .../2.36/0002-poison-system-directories.patch | 306 ++++++++++++++++++ package/binutils/Config.in.host | 8 + package/binutils/binutils.hash | 1 + 4 files changed, 363 insertions(+) create mode 100644 package/binutils/2.36/0001-sh-conf.patch create mode 100644 package/binutils/2.36/0002-poison-system-directories.patch diff --git a/package/binutils/2.36/0001-sh-conf.patch b/package/binutils/2.36/0001-sh-conf.patch new file mode 100644 index 0000000000..0070e582fa --- /dev/null +++ b/package/binutils/2.36/0001-sh-conf.patch @@ -0,0 +1,48 @@ +From f88f4c77266b9669b285ab64386cf39e183661bb 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.32] +Signed-off-by: Romain Naour +[Thomas: rebase on top of 2.29, in which sh64 support was removed.] +Signed-off-by: Thomas Petazzoni +--- + configure | 2 +- + configure.ac | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +diff --git a/configure b/configure +index 68779feb42b..8b4333b2c15 100755 +--- a/configure ++++ b/configure +@@ -3887,7 +3887,7 @@ case "${target}" in + nvptx*-*-*) + noconfigdirs="$noconfigdirs target-libssp target-libstdc++-v3 target-libobjc" + ;; +- sh-*-*) ++ sh*-*-*) + case "${target}" in + sh*-*-elf) + ;; +diff --git a/configure.ac b/configure.ac +index d16a2757689..035854759ed 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -1177,7 +1177,7 @@ case "${target}" in + nvptx*-*-*) + noconfigdirs="$noconfigdirs target-libssp target-libstdc++-v3 target-libobjc" + ;; +- sh-*-*) ++ sh*-*-*) + case "${target}" in + sh*-*-elf) + ;; +-- +2.29.2 + diff --git a/package/binutils/2.36/0002-poison-system-directories.patch b/package/binutils/2.36/0002-poison-system-directories.patch new file mode 100644 index 0000000000..071b67ac7d --- /dev/null +++ b/package/binutils/2.36/0002-poison-system-directories.patch @@ -0,0 +1,306 @@ +From a9652a60af6254d07066f08377415f05e3a9462e 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.33.1] +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.texi | 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 7b60d778587..37b8e9b6f6c 100644 +--- a/ld/config.in ++++ b/ld/config.in +@@ -40,6 +40,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 a8d248eab58..f52e1f3c18f 100755 +--- a/ld/configure ++++ b/ld/configure +@@ -828,6 +828,7 @@ with_lib_path + enable_targets + enable_64_bit_bfd + with_sysroot ++enable_poison_system_directories + enable_gold + enable_got + enable_compressed_debug_sections +@@ -1496,6 +1497,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) +@@ -15841,7 +15844,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 c9c69ab9245..59dab0a6ac4 100644 +--- a/ld/configure.ac ++++ b/ld/configure.ac +@@ -94,6 +94,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 93f5af92c7d..ff7f71a7b66 100644 +--- a/ld/ld.h ++++ b/ld/ld.h +@@ -166,6 +166,14 @@ typedef struct + in the linker script. */ + bfd_boolean force_group_allocation; + ++ /* 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.texi b/ld/ld.texi +index 7a602b9c6ab..cccbfbab3bb 100644 +--- a/ld/ld.texi ++++ b/ld/ld.texi +@@ -2810,6 +2810,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 81cb86d51e2..cd5c2752679 100644 +--- a/ld/ldfile.c ++++ b/ld/ldfile.c +@@ -117,6 +117,23 @@ ldfile_add_library_path (const char *name, bfd_boolean cmdline) + new_dirs->name = concat (ld_sysroot, name + strlen ("$SYSROOT"), (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 b0101028321..77f5accb5d9 100644 +--- a/ld/ldlex.h ++++ b/ld/ldlex.h +@@ -161,6 +161,8 @@ enum option_values + OPTION_CTF_VARIABLES, + OPTION_NO_CTF_VARIABLES, + OPTION_CTF_SHARE_TYPES, ++ 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 863df0293ea..f06f2546ef5 100644 +--- a/ld/ldmain.c ++++ b/ld/ldmain.c +@@ -323,6 +323,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 f005a58a045..eb383d3755b 100644 +--- a/ld/lexsup.c ++++ b/ld/lexsup.c +@@ -591,6 +591,14 @@ static const struct ld_option ld_options[] = + " is: share-unconflicted (default),\n" + " share-duplicated"), + 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) +@@ -603,6 +611,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; +@@ -1633,6 +1642,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), +@@ -1778,6 +1795,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) + { + einfo (_("%P: missing --end-group; added as last command line option\n")); +-- +2.29.2 + diff --git a/package/binutils/Config.in.host b/package/binutils/Config.in.host index 49daf3b70a..237aafc136 100644 --- a/package/binutils/Config.in.host +++ b/package/binutils/Config.in.host @@ -38,6 +38,13 @@ config BR2_BINUTILS_VERSION_2_35_X # https://github.com/uclinux-dev/elf2flt/issues/12 depends on !BR2_BINFMT_FLAT +config BR2_BINUTILS_VERSION_2_36_X + bool "binutils 2.36" + depends on !BR2_csky + # https://github.com/uclinux-dev/elf2flt/pull/16 + # https://github.com/uclinux-dev/elf2flt/issues/12 + depends on !BR2_BINFMT_FLAT + config BR2_BINUTILS_VERSION_ARC bool "binutils arc (2.34.50)" depends on BR2_arc @@ -56,6 +63,7 @@ config BR2_BINUTILS_VERSION default "2.33.1" if BR2_BINUTILS_VERSION_2_33_X default "2.34" if BR2_BINUTILS_VERSION_2_34_X default "2.35.2" if BR2_BINUTILS_VERSION_2_35_X + default "2.36" if BR2_BINUTILS_VERSION_2_36_X config BR2_BINUTILS_ENABLE_LTO bool diff --git a/package/binutils/binutils.hash b/package/binutils/binutils.hash index ff91e802cc..35e688a21e 100644 --- a/package/binutils/binutils.hash +++ b/package/binutils/binutils.hash @@ -3,6 +3,7 @@ sha512 d326408f12a03d9a61a9de56584c2af12f81c2e50d2d7e835d51565df8314df01575724a sha512 b7a6767c6c7ca6b5cafa7080e6820b7bb3a53b7148348c438d99905defbdf0d30c9744a484ee01c9441a8153901808513366b15ba9533e20c9673c262ade36ac binutils-2.33.1.tar.xz sha512 2c7976939dcf5e8c5b7374cccd39bfe803b1bec73c6abfa0eb17c24e1942574c6bdb874c66a092a82adc443182eacd8a5a8001c19a76101f0c7ba40c27de0bbd binutils-2.34.tar.xz sha512 9974ede5978d32e0d68fef23da48fa00bd06b0bff7ec45b00ca075c126d6bbe0cf2defc03ecc3f17bc6cc85b64271a13009c4049d7ba17de26e84e3a6e2c0348 binutils-2.35.2.tar.xz +sha512 0b89b70d4ad5cfe5bd0011dc7e342ae9de96efdbfc3442a0d6b5f7660e38bbcad36f2c72ba8f074323f02bde022ff1cd723ae99f0ea55cf94ee2dbbc0e4efdb2 binutils-2.36.tar.xz # Locally calculated (fetched from Github) sha512 76a8227a19218435319c660e4983ea17985194b7f496f163e97543e7f6fd3e9249241fdc05a16ba512fba96a1d846c1f7b080983404d821d6215f10e7f11e238 binutils-gdb-arc-2020.09-release.tar.gz From patchwork Sun Jan 31 22:33:01 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Petazzoni X-Patchwork-Id: 1433965 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=busybox.net (client-ip=140.211.166.133; helo=hemlock.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4DTQp74tVRz9sWw for ; Mon, 1 Feb 2021 09:33:19 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id 32A8E8700B; Sun, 31 Jan 2021 22:33:18 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 1c6vsBjWf1Yj; Sun, 31 Jan 2021 22:33:17 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by hemlock.osuosl.org (Postfix) with ESMTP id 8EDD68700C; Sun, 31 Jan 2021 22:33:17 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) by ash.osuosl.org (Postfix) with ESMTP id 925BC1BF395 for ; Sun, 31 Jan 2021 22:33:15 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id 88BE120386 for ; Sun, 31 Jan 2021 22:33:15 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id uLmSjS0cx2Ta for ; Sun, 31 Jan 2021 22:33:14 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from relay2-d.mail.gandi.net (relay2-d.mail.gandi.net [217.70.183.194]) by silver.osuosl.org (Postfix) with ESMTPS id 924ED2034F for ; Sun, 31 Jan 2021 22:33:14 +0000 (UTC) X-Originating-IP: 185.200.12.8 Received: from localhost (unknown [185.200.12.8]) (Authenticated sender: thomas.petazzoni@bootlin.com) by relay2-d.mail.gandi.net (Postfix) with ESMTPSA id CE98F40007; Sun, 31 Jan 2021 22:33:12 +0000 (UTC) From: Thomas Petazzoni To: Buildroot List Date: Sun, 31 Jan 2021 23:33:01 +0100 Message-Id: <20210131223304.1857838-3-thomas.petazzoni@bootlin.com> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210131223304.1857838-1-thomas.petazzoni@bootlin.com> References: <20210131223304.1857838-1-thomas.petazzoni@bootlin.com> MIME-Version: 1.0 Subject: [Buildroot] [PATCH 3/5] package/binutils: switch to 2.35.x as the default version X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Romain Naour , Thomas Petazzoni Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" Now that 2.36 has been released, let's use 2.35.x as the default binutils version. Signed-off-by: Thomas Petazzoni --- package/binutils/Config.in.host | 2 +- package/binutils/binutils.mk | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package/binutils/Config.in.host b/package/binutils/Config.in.host index 237aafc136..d857c485d3 100644 --- a/package/binutils/Config.in.host +++ b/package/binutils/Config.in.host @@ -7,7 +7,7 @@ config BR2_PACKAGE_HOST_BINUTILS_SUPPORTS_CFI choice prompt "Binutils Version" - default BR2_BINUTILS_VERSION_2_34_X if !BR2_arc && !BR2_csky + default BR2_BINUTILS_VERSION_2_35_X if !BR2_arc && !BR2_csky default BR2_BINUTILS_VERSION_ARC if BR2_arc default BR2_BINUTILS_VERSION_CSKY if BR2_csky help diff --git a/package/binutils/binutils.mk b/package/binutils/binutils.mk index aff7f4ba86..e469febbb4 100644 --- a/package/binutils/binutils.mk +++ b/package/binutils/binutils.mk @@ -11,7 +11,7 @@ ifeq ($(BINUTILS_VERSION),) ifeq ($(BR2_arc),y) BINUTILS_VERSION = arc-2020.09-release else -BINUTILS_VERSION = 2.34 +BINUTILS_VERSION = 2.35.2 endif endif # BINUTILS_VERSION From patchwork Sun Jan 31 22:33:02 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Petazzoni X-Patchwork-Id: 1433967 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=busybox.net (client-ip=140.211.166.133; helo=hemlock.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4DTQpL5r5zz9sWw for ; Mon, 1 Feb 2021 09:33:30 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id 4F0718700C; Sun, 31 Jan 2021 22:33:29 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Af1Shq09CrBh; Sun, 31 Jan 2021 22:33:26 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by hemlock.osuosl.org (Postfix) with ESMTP id 5126887042; Sun, 31 Jan 2021 22:33:25 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) by ash.osuosl.org (Postfix) with ESMTP id 579E51BF395 for ; Sun, 31 Jan 2021 22:33:21 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id 0CD0387014 for ; Sun, 31 Jan 2021 22:33:21 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id iUrhjnIyj75D for ; Sun, 31 Jan 2021 22:33:17 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from relay7-d.mail.gandi.net (relay7-d.mail.gandi.net [217.70.183.200]) by hemlock.osuosl.org (Postfix) with ESMTPS id 7CE0D87005 for ; Sun, 31 Jan 2021 22:33:16 +0000 (UTC) X-Originating-IP: 185.200.12.8 Received: from localhost (unknown [185.200.12.8]) (Authenticated sender: thomas.petazzoni@bootlin.com) by relay7-d.mail.gandi.net (Postfix) with ESMTPSA id 43FB320002; Sun, 31 Jan 2021 22:33:14 +0000 (UTC) From: Thomas Petazzoni To: Buildroot List Date: Sun, 31 Jan 2021 23:33:02 +0100 Message-Id: <20210131223304.1857838-4-thomas.petazzoni@bootlin.com> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210131223304.1857838-1-thomas.petazzoni@bootlin.com> References: <20210131223304.1857838-1-thomas.petazzoni@bootlin.com> MIME-Version: 1.0 Subject: [Buildroot] [PATCH 4/5] package/binutils: drop 2.33.x series X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Romain Naour , Thomas Petazzoni Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" Now that 2.36.x has been added, that 2.35.x is the default version, drop support for 2.33.x. Note that we keep binutils 2.32.x as it is the latest version that works for FLAT binaries (used on noMMU platforms). Signed-off-by: Thomas Petazzoni --- Config.in.legacy | 7 + package/binutils/2.33.1/0001-sh-conf.patch | 48 -- .../0002-poison-system-directories.patch | 306 ------------- .../0004-bfd-xtensa-fix-PR-ld-25630.patch | 37 -- .../2.33.1/0005-xtensa-fix-PR-ld-25861.patch | 432 ------------------ ...TENSA_NDIFF-handling-for-PR-ld-25861.patch | 128 ------ package/binutils/Config.in.host | 8 - package/binutils/binutils.hash | 1 - 8 files changed, 7 insertions(+), 960 deletions(-) delete mode 100644 package/binutils/2.33.1/0001-sh-conf.patch delete mode 100644 package/binutils/2.33.1/0002-poison-system-directories.patch delete mode 100644 package/binutils/2.33.1/0004-bfd-xtensa-fix-PR-ld-25630.patch delete mode 100644 package/binutils/2.33.1/0005-xtensa-fix-PR-ld-25861.patch delete mode 100644 package/binutils/2.33.1/0006-xtensa-fix-XTENSA_NDIFF-handling-for-PR-ld-25861.patch diff --git a/Config.in.legacy b/Config.in.legacy index 2bf39d7175..18f9bc5478 100644 --- a/Config.in.legacy +++ b/Config.in.legacy @@ -146,6 +146,13 @@ endif comment "Legacy options removed in 2021.02" +config BR2_BINUTILS_VERSION_2_33_X + bool "binutils 2.33.x has been removed" + select BR2_LEGACY + help + binutils 2.33.x has been removed, use a newer version. + + config BR2_PACKAGE_LIBUPNP18 bool "libupnp18 package removed" select BR2_LEGACY diff --git a/package/binutils/2.33.1/0001-sh-conf.patch b/package/binutils/2.33.1/0001-sh-conf.patch deleted file mode 100644 index 035100db82..0000000000 --- a/package/binutils/2.33.1/0001-sh-conf.patch +++ /dev/null @@ -1,48 +0,0 @@ -From 3220c7e65ccfe41eceaaa6f1707f7f5775d9a4b0 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.32] -Signed-off-by: Romain Naour -[Thomas: rebase on top of 2.29, in which sh64 support was removed.] -Signed-off-by: Thomas Petazzoni ---- - configure | 2 +- - configure.ac | 2 +- - 2 files changed, 2 insertions(+), 2 deletions(-) - -diff --git a/configure b/configure -index 6a9719f6091..796641b6aa3 100755 ---- a/configure -+++ b/configure -@@ -3865,7 +3865,7 @@ case "${target}" in - nvptx*-*-*) - noconfigdirs="$noconfigdirs target-libssp target-libstdc++-v3 target-libobjc" - ;; -- sh-*-*) -+ sh*-*-*) - case "${target}" in - sh*-*-elf) - ;; -diff --git a/configure.ac b/configure.ac -index 7433badc217..dce082fb58e 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -1158,7 +1158,7 @@ case "${target}" in - nvptx*-*-*) - noconfigdirs="$noconfigdirs target-libssp target-libstdc++-v3 target-libobjc" - ;; -- sh-*-*) -+ sh*-*-*) - case "${target}" in - sh*-*-elf) - ;; --- -2.23.0 - diff --git a/package/binutils/2.33.1/0002-poison-system-directories.patch b/package/binutils/2.33.1/0002-poison-system-directories.patch deleted file mode 100644 index 9eafcbe18c..0000000000 --- a/package/binutils/2.33.1/0002-poison-system-directories.patch +++ /dev/null @@ -1,306 +0,0 @@ -From 276cba370773e8f12dc8b186b71827a01d5c9097 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.33.1] -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.texi | 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 d93c9b08300..5da2742beac 100644 ---- a/ld/config.in -+++ b/ld/config.in -@@ -31,6 +31,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 b532ef94fa2..65d12cbf883 100755 ---- a/ld/configure -+++ b/ld/configure -@@ -823,6 +823,7 @@ with_lib_path - enable_targets - enable_64_bit_bfd - with_sysroot -+enable_poison_system_directories - enable_gold - enable_got - enable_compressed_debug_sections -@@ -1487,6 +1488,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) -@@ -15804,7 +15807,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 ee62d10ac58..bc3e14e729d 100644 ---- a/ld/configure.ac -+++ b/ld/configure.ac -@@ -94,6 +94,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 55078a9637b..511e9bc34b7 100644 ---- a/ld/ld.h -+++ b/ld/ld.h -@@ -180,6 +180,14 @@ typedef struct - in the linker script. */ - bfd_boolean force_group_allocation; - -+ /* 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.texi b/ld/ld.texi -index b3447050ed2..efd50edd85c 100644 ---- a/ld/ld.texi -+++ b/ld/ld.texi -@@ -2557,6 +2557,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 7f60319390e..0bcc06db964 100644 ---- a/ld/ldfile.c -+++ b/ld/ldfile.c -@@ -116,6 +116,23 @@ ldfile_add_library_path (const char *name, bfd_boolean cmdline) - new_dirs->name = concat (ld_sysroot, name + strlen ("$SYSROOT"), (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 32a7a6409e8..c02b64bf92f 100644 ---- a/ld/ldlex.h -+++ b/ld/ldlex.h -@@ -150,6 +150,8 @@ enum option_values - OPTION_FORCE_GROUP_ALLOCATION, - OPTION_PRINT_MAP_DISCARDED, - OPTION_NO_PRINT_MAP_DISCARDED, -+ 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 e24194ef87d..2d683cb6c5a 100644 ---- a/ld/ldmain.c -+++ b/ld/ldmain.c -@@ -270,6 +270,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 1c15ac29c0c..8b714e10a40 100644 ---- a/ld/lexsup.c -+++ b/ld/lexsup.c -@@ -549,6 +549,14 @@ static const struct ld_option ld_options[] = - { {"no-print-map-discarded", no_argument, NULL, OPTION_NO_PRINT_MAP_DISCARDED}, - '\0', NULL, N_("Do not show discarded sections in map file output"), - 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) -@@ -561,6 +569,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; -@@ -1549,6 +1558,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), -@@ -1600,6 +1617,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) - { - einfo (_("%P: missing --end-group; added as last command line option\n")); --- -2.23.0 - diff --git a/package/binutils/2.33.1/0004-bfd-xtensa-fix-PR-ld-25630.patch b/package/binutils/2.33.1/0004-bfd-xtensa-fix-PR-ld-25630.patch deleted file mode 100644 index f499426b70..0000000000 --- a/package/binutils/2.33.1/0004-bfd-xtensa-fix-PR-ld-25630.patch +++ /dev/null @@ -1,37 +0,0 @@ -From 85dcca5997cf3822d6456a5c9c59c46b56adfbb8 Mon Sep 17 00:00:00 2001 -From: Max Filippov -Date: Wed, 4 Mar 2020 14:54:27 -0800 -Subject: [PATCH] bfd: xtensa: fix PR ld/25630 - -bfd/ -2020-03-05 Max Filippov - - * elf32-xtensa.c (shrink_dynamic_reloc_sections): Shrink dynamic - relocation sections for any removed reference to a dynamic symbol. - -Signed-off-by: Max Filippov ---- - bfd/elf32-xtensa.c | 7 +++---- - 1 file changed, 3 insertions(+), 4 deletions(-) - -diff --git a/bfd/elf32-xtensa.c b/bfd/elf32-xtensa.c -index 12ff9f772aaf..65e14d87940c 100644 ---- a/bfd/elf32-xtensa.c -+++ b/bfd/elf32-xtensa.c -@@ -10148,10 +10148,9 @@ shrink_dynamic_reloc_sections (struct bfd_link_info *info, - - if ((r_type == R_XTENSA_32 || r_type == R_XTENSA_PLT) - && (input_section->flags & SEC_ALLOC) != 0 -- && (dynamic_symbol || bfd_link_pic (info)) -- && (!h || h->root.type != bfd_link_hash_undefweak -- || (dynamic_symbol -- && (bfd_link_dll (info) || info->export_dynamic)))) -+ && (dynamic_symbol -+ || (bfd_link_pic (info) -+ && (!h || h->root.type != bfd_link_hash_undefweak)))) - { - asection *srel; - bfd_boolean is_plt = FALSE; --- -2.20.1 - diff --git a/package/binutils/2.33.1/0005-xtensa-fix-PR-ld-25861.patch b/package/binutils/2.33.1/0005-xtensa-fix-PR-ld-25861.patch deleted file mode 100644 index 2df46c6526..0000000000 --- a/package/binutils/2.33.1/0005-xtensa-fix-PR-ld-25861.patch +++ /dev/null @@ -1,432 +0,0 @@ -From c7a1d1f656c717394937a92cb970f0f4cecce128 Mon Sep 17 00:00:00 2001 -From: Max Filippov -Date: Sun, 19 Apr 2020 19:04:41 -0700 -Subject: [PATCH] xtensa: fix PR ld/25861 - -Introduce new relaxations XTENSA_PDIFF{8,16,32} for positive differences -(subtracted symbol precedes diminished symbol) and XTENSA_NDIFF{8,16,32} -for negative differences (subtracted symbol follows diminished symbol). -Don't generate XTENSA_DIFF relocations in the assembler, generate -XTENSA_PDIFF or XTENSA_NDIFF based on relative symbol position. - -Handle XTENSA_DIFF in BFD for compatibility with old object files. -Handle XTENSA_PDIFF and XTENSA_NDIFF in BFD, treating difference value -as unsigned. - -2020-04-22 Max Filippov -bfd/ - * bfd-in2.h: Regenerated. - * elf32-xtensa.c (elf_howto_table): New entries for - R_XTENSA_PDIFF{8,16,32} and R_XTENSA_NDIFF{8,16,32}. - (elf_xtensa_reloc_type_lookup, elf_xtensa_do_reloc) - (relax_section): Add cases for R_XTENSA_PDIFF{8,16,32} and - R_XTENSA_NDIFF{8,16,32}. - * libbfd.h (bfd_reloc_code_real_names): Add names for - BFD_RELOC_XTENSA_PDIFF{8,16,32} and - BFD_RELOC_XTENSA_NDIFF{8,16,32}. - * reloc.c: Add documentation for BFD_RELOC_XTENSA_PDIFF{8,16,32} - and BFD_RELOC_XTENSA_NDIFF{8,16,32}. - -binutils/ - * readelf.c (is_none_reloc): Recognize - BFD_RELOC_XTENSA_PDIFF{8,16,32} and - BFD_RELOC_XTENSA_NDIFF{8,16,32}. - -gas/ - * config/tc-xtensa.c (md_apply_fix): Replace - BFD_RELOC_XTENSA_DIFF{8,16,32} generation with - BFD_RELOC_XTENSA_PDIFF{8,16,32} and - BFD_RELOC_XTENSA_NDIFF{8,16,32} generation. - * testsuite/gas/xtensa/loc.d: Replace BFD_RELOC_XTENSA_DIFF16 - with BFD_RELOC_XTENSA_PDIFF16 in the expected output. - -include/ - * elf/xtensa.h (elf_xtensa_reloc_type): New entries for - R_XTENSA_PDIFF{8,16,32} and R_XTENSA_NDIFF{8,16,32}. - -ld/ - * testsuite/ld-xtensa/relax-loc.d: New test definition. - * testsuite/ld-xtensa/relax-loc.s: New test source. - * testsuite/ld-xtensa/xtensa.exp (relax-loc): New test. - -Signed-off-by: Max Filippov ---- -Backported from: 30ce8e47fad9b057b6d7af9e1d43061126d34d20 - - bfd/bfd-in2.h | 20 ++++++- - bfd/elf32-xtensa.c | 89 +++++++++++++++++++++++++++++- - bfd/libbfd.h | 6 ++ - bfd/reloc.c | 24 ++++++++ - binutils/readelf.c | 8 ++- - gas/config/tc-xtensa.c | 12 +++- - gas/testsuite/gas/xtensa/loc.d | 2 +- - include/elf/xtensa.h | 6 ++ - ld/testsuite/ld-xtensa/relax-loc.d | 7 +++ - ld/testsuite/ld-xtensa/relax-loc.s | 15 +++++ - ld/testsuite/ld-xtensa/xtensa.exp | 1 + - 11 files changed, 183 insertions(+), 7 deletions(-) - create mode 100644 ld/testsuite/ld-xtensa/relax-loc.d - create mode 100644 ld/testsuite/ld-xtensa/relax-loc.s - -diff --git a/bfd/bfd-in2.h b/bfd/bfd-in2.h -index 37114607b515..be6a30f57955 100644 ---- a/bfd/bfd-in2.h -+++ b/bfd/bfd-in2.h -@@ -5217,7 +5217,9 @@ to one of its own internal functions or data structures. */ - PLT entries. Otherwise, this is just a generic 32-bit relocation. */ - BFD_RELOC_XTENSA_PLT, - --/* Xtensa relocations to mark the difference of two local symbols. -+/* Xtensa relocations for backward compatibility. These have been replaced -+by BFD_RELOC_XTENSA_PDIFF and BFD_RELOC_XTENSA_NDIFF. -+Xtensa relocations to mark the difference of two local symbols. - These are only needed to support linker relaxation and can be ignored - when not relaxing. The field is set to the value of the difference - assuming no relaxation. The relocation encodes the position of the -@@ -5291,6 +5293,22 @@ BFD_RELOC_XTENSA_ASM_EXPAND. */ - BFD_RELOC_XTENSA_TLS_ARG, - BFD_RELOC_XTENSA_TLS_CALL, - -+/* Xtensa relocations to mark the difference of two local symbols. -+These are only needed to support linker relaxation and can be ignored -+when not relaxing. The field is set to the value of the difference -+assuming no relaxation. The relocation encodes the position of the -+subtracted symbol so the linker can determine whether to adjust the field -+value. PDIFF relocations are used for positive differences, NDIFF -+relocations are used for negative differences. The difference value -+is treated as unsigned with these relocation types, giving full -+8/16 value ranges. */ -+ BFD_RELOC_XTENSA_PDIFF8, -+ BFD_RELOC_XTENSA_PDIFF16, -+ BFD_RELOC_XTENSA_PDIFF32, -+ BFD_RELOC_XTENSA_NDIFF8, -+ BFD_RELOC_XTENSA_NDIFF16, -+ BFD_RELOC_XTENSA_NDIFF32, -+ - /* 8 bit signed offset in (ix+d) or (iy+d). */ - BFD_RELOC_Z80_DISP8, - -diff --git a/bfd/elf32-xtensa.c b/bfd/elf32-xtensa.c -index 473a9d76f289..fded42d52a9a 100644 ---- a/bfd/elf32-xtensa.c -+++ b/bfd/elf32-xtensa.c -@@ -325,6 +325,20 @@ static reloc_howto_type elf_howto_table[] = - HOWTO (R_XTENSA_TLS_CALL, 0, 0, 0, FALSE, 0, complain_overflow_dont, - bfd_elf_xtensa_reloc, "R_XTENSA_TLS_CALL", - FALSE, 0, 0, FALSE), -+ -+ HOWTO (R_XTENSA_PDIFF8, 0, 0, 8, FALSE, 0, complain_overflow_bitfield, -+ bfd_elf_xtensa_reloc, "R_XTENSA_PDIFF8", FALSE, 0, 0xff, FALSE), -+ HOWTO (R_XTENSA_PDIFF16, 0, 1, 16, FALSE, 0, complain_overflow_bitfield, -+ bfd_elf_xtensa_reloc, "R_XTENSA_PDIFF16", FALSE, 0, 0xffff, FALSE), -+ HOWTO (R_XTENSA_PDIFF32, 0, 2, 32, FALSE, 0, complain_overflow_bitfield, -+ bfd_elf_xtensa_reloc, "R_XTENSA_PDIFF32", FALSE, 0, 0xffffffff, FALSE), -+ -+ HOWTO (R_XTENSA_NDIFF8, 0, 0, 8, FALSE, 0, complain_overflow_bitfield, -+ bfd_elf_xtensa_reloc, "R_XTENSA_NDIFF8", FALSE, 0, 0xff, FALSE), -+ HOWTO (R_XTENSA_NDIFF16, 0, 1, 16, FALSE, 0, complain_overflow_bitfield, -+ bfd_elf_xtensa_reloc, "R_XTENSA_NDIFF16", FALSE, 0, 0xffff, FALSE), -+ HOWTO (R_XTENSA_NDIFF32, 0, 2, 32, FALSE, 0, complain_overflow_bitfield, -+ bfd_elf_xtensa_reloc, "R_XTENSA_NDIFF32", FALSE, 0, 0xffffffff, FALSE), - }; - - #if DEBUG_GEN_RELOC -@@ -364,6 +378,30 @@ elf_xtensa_reloc_type_lookup (bfd *abfd ATTRIBUTE_UNUSED, - TRACE ("BFD_RELOC_XTENSA_DIFF32"); - return &elf_howto_table[(unsigned) R_XTENSA_DIFF32 ]; - -+ case BFD_RELOC_XTENSA_PDIFF8: -+ TRACE ("BFD_RELOC_XTENSA_PDIFF8"); -+ return &elf_howto_table[(unsigned) R_XTENSA_PDIFF8 ]; -+ -+ case BFD_RELOC_XTENSA_PDIFF16: -+ TRACE ("BFD_RELOC_XTENSA_PDIFF16"); -+ return &elf_howto_table[(unsigned) R_XTENSA_PDIFF16 ]; -+ -+ case BFD_RELOC_XTENSA_PDIFF32: -+ TRACE ("BFD_RELOC_XTENSA_PDIFF32"); -+ return &elf_howto_table[(unsigned) R_XTENSA_PDIFF32 ]; -+ -+ case BFD_RELOC_XTENSA_NDIFF8: -+ TRACE ("BFD_RELOC_XTENSA_NDIFF8"); -+ return &elf_howto_table[(unsigned) R_XTENSA_NDIFF8 ]; -+ -+ case BFD_RELOC_XTENSA_NDIFF16: -+ TRACE ("BFD_RELOC_XTENSA_NDIFF16"); -+ return &elf_howto_table[(unsigned) R_XTENSA_NDIFF16 ]; -+ -+ case BFD_RELOC_XTENSA_NDIFF32: -+ TRACE ("BFD_RELOC_XTENSA_NDIFF32"); -+ return &elf_howto_table[(unsigned) R_XTENSA_NDIFF32 ]; -+ - case BFD_RELOC_XTENSA_RTLD: - TRACE ("BFD_RELOC_XTENSA_RTLD"); - return &elf_howto_table[(unsigned) R_XTENSA_RTLD ]; -@@ -1851,6 +1889,12 @@ elf_xtensa_do_reloc (reloc_howto_type *howto, - case R_XTENSA_DIFF8: - case R_XTENSA_DIFF16: - case R_XTENSA_DIFF32: -+ case R_XTENSA_PDIFF8: -+ case R_XTENSA_PDIFF16: -+ case R_XTENSA_PDIFF32: -+ case R_XTENSA_NDIFF8: -+ case R_XTENSA_NDIFF16: -+ case R_XTENSA_NDIFF32: - case R_XTENSA_TLS_FUNC: - case R_XTENSA_TLS_ARG: - case R_XTENSA_TLS_CALL: -@@ -9604,7 +9648,13 @@ relax_section (bfd *abfd, asection *sec, struct bfd_link_info *link_info) - - if (r_type == R_XTENSA_DIFF8 - || r_type == R_XTENSA_DIFF16 -- || r_type == R_XTENSA_DIFF32) -+ || r_type == R_XTENSA_DIFF32 -+ || r_type == R_XTENSA_PDIFF8 -+ || r_type == R_XTENSA_PDIFF16 -+ || r_type == R_XTENSA_PDIFF32 -+ || r_type == R_XTENSA_NDIFF8 -+ || r_type == R_XTENSA_NDIFF16 -+ || r_type == R_XTENSA_NDIFF32) - { - bfd_signed_vma diff_value = 0; - bfd_vma new_end_offset, diff_mask = 0; -@@ -9631,8 +9681,27 @@ relax_section (bfd *abfd, asection *sec, struct bfd_link_info *link_info) - diff_value = - bfd_get_signed_32 (abfd, &contents[old_source_offset]); - break; -+ case R_XTENSA_PDIFF8: -+ case R_XTENSA_NDIFF8: -+ diff_value = -+ bfd_get_8 (abfd, &contents[old_source_offset]); -+ break; -+ case R_XTENSA_PDIFF16: -+ case R_XTENSA_NDIFF16: -+ diff_value = -+ bfd_get_16 (abfd, &contents[old_source_offset]); -+ break; -+ case R_XTENSA_PDIFF32: -+ case R_XTENSA_NDIFF32: -+ diff_value = -+ bfd_get_32 (abfd, &contents[old_source_offset]); -+ break; - } - -+ if (r_type >= R_XTENSA_NDIFF8 -+ && r_type <= R_XTENSA_NDIFF32) -+ diff_value = -diff_value; -+ - new_end_offset = offset_with_removed_text_map - (&target_relax_info->action_list, - r_rel.target_offset + diff_value); -@@ -9655,6 +9724,24 @@ relax_section (bfd *abfd, asection *sec, struct bfd_link_info *link_info) - bfd_put_signed_32 (abfd, diff_value, - &contents[old_source_offset]); - break; -+ case R_XTENSA_PDIFF8: -+ case R_XTENSA_NDIFF8: -+ diff_mask = 0xff; -+ bfd_put_8 (abfd, diff_value, -+ &contents[old_source_offset]); -+ break; -+ case R_XTENSA_PDIFF16: -+ case R_XTENSA_NDIFF16: -+ diff_mask = 0xffff; -+ bfd_put_16 (abfd, diff_value, -+ &contents[old_source_offset]); -+ break; -+ case R_XTENSA_PDIFF32: -+ case R_XTENSA_NDIFF32: -+ diff_mask = 0xffffffff; -+ bfd_put_32 (abfd, diff_value, -+ &contents[old_source_offset]); -+ break; - } - - /* Check for overflow. Sign bits must be all zeroes or all ones */ -diff --git a/bfd/libbfd.h b/bfd/libbfd.h -index 3c184fcadadf..989f4bc0b595 100644 ---- a/bfd/libbfd.h -+++ b/bfd/libbfd.h -@@ -2919,6 +2919,12 @@ static const char *const bfd_reloc_code_real_names[] = { "@@uninitialized@@", - "BFD_RELOC_XTENSA_TLS_FUNC", - "BFD_RELOC_XTENSA_TLS_ARG", - "BFD_RELOC_XTENSA_TLS_CALL", -+ "BFD_RELOC_XTENSA_PDIFF8", -+ "BFD_RELOC_XTENSA_PDIFF16", -+ "BFD_RELOC_XTENSA_PDIFF32", -+ "BFD_RELOC_XTENSA_NDIFF8", -+ "BFD_RELOC_XTENSA_NDIFF16", -+ "BFD_RELOC_XTENSA_NDIFF32", - "BFD_RELOC_Z80_DISP8", - "BFD_RELOC_Z80_BYTE0", - "BFD_RELOC_Z80_BYTE1", -diff --git a/bfd/reloc.c b/bfd/reloc.c -index c4dec86d1d46..f5df8e2ab3eb 100644 ---- a/bfd/reloc.c -+++ b/bfd/reloc.c -@@ -6556,6 +6556,8 @@ ENUMX - ENUMX - BFD_RELOC_XTENSA_DIFF32 - ENUMDOC -+ Xtensa relocations for backward compatibility. These have been replaced -+ by BFD_RELOC_XTENSA_PDIFF and BFD_RELOC_XTENSA_NDIFF. - Xtensa relocations to mark the difference of two local symbols. - These are only needed to support linker relaxation and can be ignored - when not relaxing. The field is set to the value of the difference -@@ -6668,6 +6670,28 @@ ENUMX - BFD_RELOC_XTENSA_TLS_CALL - ENUMDOC - Xtensa TLS relocations. -+ENUM -+ BFD_RELOC_XTENSA_PDIFF8 -+ENUMX -+ BFD_RELOC_XTENSA_PDIFF16 -+ENUMX -+ BFD_RELOC_XTENSA_PDIFF32 -+ENUMX -+ BFD_RELOC_XTENSA_NDIFF8 -+ENUMX -+ BFD_RELOC_XTENSA_NDIFF16 -+ENUMX -+ BFD_RELOC_XTENSA_NDIFF32 -+ENUMDOC -+ Xtensa relocations to mark the difference of two local symbols. -+ These are only needed to support linker relaxation and can be ignored -+ when not relaxing. The field is set to the value of the difference -+ assuming no relaxation. The relocation encodes the position of the -+ subtracted symbol so the linker can determine whether to adjust the field -+ value. PDIFF relocations are used for positive differences, NDIFF -+ relocations are used for negative differences. The difference value -+ is treated as unsigned with these relocation types, giving full -+ 8/16 value ranges. - - ENUM - BFD_RELOC_Z80_DISP8 -diff --git a/binutils/readelf.c b/binutils/readelf.c -index d4756c93b345..800918f901c8 100644 ---- a/binutils/readelf.c -+++ b/binutils/readelf.c -@@ -13262,7 +13262,13 @@ is_none_reloc (Filedata * filedata, unsigned int reloc_type) - return (reloc_type == 0 /* R_XTENSA_NONE. */ - || reloc_type == 17 /* R_XTENSA_DIFF8. */ - || reloc_type == 18 /* R_XTENSA_DIFF16. */ -- || reloc_type == 19 /* R_XTENSA_DIFF32. */); -+ || reloc_type == 19 /* R_XTENSA_DIFF32. */ -+ || reloc_type == 57 /* R_XTENSA_PDIFF8. */ -+ || reloc_type == 58 /* R_XTENSA_PDIFF16. */ -+ || reloc_type == 59 /* R_XTENSA_PDIFF32. */ -+ || reloc_type == 60 /* R_XTENSA_NDIFF8. */ -+ || reloc_type == 61 /* R_XTENSA_NDIFF16. */ -+ || reloc_type == 62 /* R_XTENSA_NDIFF32. */); - } - return FALSE; - } -diff --git a/gas/config/tc-xtensa.c b/gas/config/tc-xtensa.c -index 71d4d94a8d7d..ee75c13548ff 100644 ---- a/gas/config/tc-xtensa.c -+++ b/gas/config/tc-xtensa.c -@@ -5974,18 +5974,24 @@ md_apply_fix (fixS *fixP, valueT *valP, segT seg) - case BFD_RELOC_8: - if (fixP->fx_subsy) - { -+ bfd_boolean neg = S_GET_VALUE (fixP->fx_addsy) + fixP->fx_offset -+ < S_GET_VALUE (fixP->fx_subsy); -+ - switch (fixP->fx_r_type) - { - case BFD_RELOC_8: -- fixP->fx_r_type = BFD_RELOC_XTENSA_DIFF8; -+ fixP->fx_r_type = neg -+ ? BFD_RELOC_XTENSA_NDIFF8 : BFD_RELOC_XTENSA_PDIFF8; - fixP->fx_signed = 0; - break; - case BFD_RELOC_16: -- fixP->fx_r_type = BFD_RELOC_XTENSA_DIFF16; -+ fixP->fx_r_type = neg -+ ? BFD_RELOC_XTENSA_NDIFF16 : BFD_RELOC_XTENSA_PDIFF16; - fixP->fx_signed = 0; - break; - case BFD_RELOC_32: -- fixP->fx_r_type = BFD_RELOC_XTENSA_DIFF32; -+ fixP->fx_r_type = neg -+ ? BFD_RELOC_XTENSA_NDIFF32 : BFD_RELOC_XTENSA_PDIFF32; - fixP->fx_signed = 0; - break; - default: -diff --git a/gas/testsuite/gas/xtensa/loc.d b/gas/testsuite/gas/xtensa/loc.d -index 71983cc90055..8fb3425999d5 100644 ---- a/gas/testsuite/gas/xtensa/loc.d -+++ b/gas/testsuite/gas/xtensa/loc.d -@@ -6,5 +6,5 @@ - - RELOCATION RECORDS FOR \[\.debug_line\]: - #... --.*R_XTENSA_DIFF16.*\.text\+0x00009c42 -+.*R_XTENSA_PDIFF16.*\.text\+0x00009c42 - #... -diff --git a/include/elf/xtensa.h b/include/elf/xtensa.h -index 2eb5e4e52941..bd5c80d13777 100644 ---- a/include/elf/xtensa.h -+++ b/include/elf/xtensa.h -@@ -87,6 +87,12 @@ START_RELOC_NUMBERS (elf_xtensa_reloc_type) - RELOC_NUMBER (R_XTENSA_TLS_FUNC, 54) - RELOC_NUMBER (R_XTENSA_TLS_ARG, 55) - RELOC_NUMBER (R_XTENSA_TLS_CALL, 56) -+ RELOC_NUMBER (R_XTENSA_PDIFF8, 57) -+ RELOC_NUMBER (R_XTENSA_PDIFF16, 58) -+ RELOC_NUMBER (R_XTENSA_PDIFF32, 59) -+ RELOC_NUMBER (R_XTENSA_NDIFF8, 60) -+ RELOC_NUMBER (R_XTENSA_NDIFF16, 61) -+ RELOC_NUMBER (R_XTENSA_NDIFF32, 62) - END_RELOC_NUMBERS (R_XTENSA_max) - - /* Processor-specific flags for the ELF header e_flags field. */ -diff --git a/ld/testsuite/ld-xtensa/relax-loc.d b/ld/testsuite/ld-xtensa/relax-loc.d -new file mode 100644 -index 000000000000..3c8d673732ff ---- /dev/null -+++ b/ld/testsuite/ld-xtensa/relax-loc.d -@@ -0,0 +1,7 @@ -+#as: --text-section-literals -+#ld: -+#objdump: --dwarf=decodedline -+#... -+relax-loc.s[ ]+1[ ]+0x400054[ ]+.* -+relax-loc.s[ ]+2[ ]+0x40005c[ ]+.* -+#... -diff --git a/ld/testsuite/ld-xtensa/relax-loc.s b/ld/testsuite/ld-xtensa/relax-loc.s -new file mode 100644 -index 000000000000..d768470e287a ---- /dev/null -+++ b/ld/testsuite/ld-xtensa/relax-loc.s -@@ -0,0 +1,15 @@ -+ .file 1 "relax-loc.s" -+ .globl _start -+ .globl _ResetVector -+ .text -+_ResetVector: -+_start: -+ .loc 1 1 -+ j 1f -+ .literal_position -+1: -+ .loc 1 2 -+ -+ .rep 10000 -+ movi a2, 0x12345678 -+ .endr -diff --git a/ld/testsuite/ld-xtensa/xtensa.exp b/ld/testsuite/ld-xtensa/xtensa.exp -index 9b2235b2151b..de39887936ad 100644 ---- a/ld/testsuite/ld-xtensa/xtensa.exp -+++ b/ld/testsuite/ld-xtensa/xtensa.exp -@@ -27,6 +27,7 @@ run_dump_test "call_overflow" - run_dump_test "coalesce" - run_dump_test "diff_overflow" - run_dump_test "lcall" -+run_dump_test "relax-loc" - - run_dump_test "relax-static-pie" - run_dump_test "relax-static-local-pie" --- -2.20.1 - diff --git a/package/binutils/2.33.1/0006-xtensa-fix-XTENSA_NDIFF-handling-for-PR-ld-25861.patch b/package/binutils/2.33.1/0006-xtensa-fix-XTENSA_NDIFF-handling-for-PR-ld-25861.patch deleted file mode 100644 index 28f17d7c56..0000000000 --- a/package/binutils/2.33.1/0006-xtensa-fix-XTENSA_NDIFF-handling-for-PR-ld-25861.patch +++ /dev/null @@ -1,128 +0,0 @@ -From 735321812435ae278d3766a3371f55937dc776d6 Mon Sep 17 00:00:00 2001 -From: Max Filippov -Date: Sat, 25 Apr 2020 00:40:25 -0700 -Subject: [PATCH] xtensa: fix XTENSA_NDIFF handling for PR ld/25861 - -Fields marked with XTENSA_NDIFF relocations are not negated, they only -have sign bits removed. Don't negate their values when relaxation is -performed. Don't add sign bits when the value is zero. Report overflow -when the result has negative sign but all significant bits are zero. - -2020-04-29 Max Filippov -bfd/ - * elf32-xtensa.c (relax_section): Don't negate diff_value for - XTENSA_NDIFF relocations. Don't add sign bits whe diff_value - equals 0. Report overflow when the result has negative sign but - all significant bits are zero. - -Signed-off-by: Max Filippov -Backported from: d548f47df4d2e3d117d504a4c9977982c78a0556 ---- - - bfd/elf32-xtensa.c | 26 +++++++++++++++----------- - 1 file changed, 15 insertions(+), 11 deletions(-) - -diff --git a/bfd/elf32-xtensa.c b/bfd/elf32-xtensa.c -index fded42d52a9a..4327b027911f 100644 ---- a/bfd/elf32-xtensa.c -+++ b/bfd/elf32-xtensa.c -@@ -9670,37 +9670,44 @@ relax_section (bfd *abfd, asection *sec, struct bfd_link_info *link_info) - switch (r_type) - { - case R_XTENSA_DIFF8: -+ diff_mask = 0x7f; - diff_value = - bfd_get_signed_8 (abfd, &contents[old_source_offset]); - break; - case R_XTENSA_DIFF16: -+ diff_mask = 0x7fff; - diff_value = - bfd_get_signed_16 (abfd, &contents[old_source_offset]); - break; - case R_XTENSA_DIFF32: -+ diff_mask = 0x7fffffff; - diff_value = - bfd_get_signed_32 (abfd, &contents[old_source_offset]); - break; - case R_XTENSA_PDIFF8: - case R_XTENSA_NDIFF8: -+ diff_mask = 0xff; - diff_value = - bfd_get_8 (abfd, &contents[old_source_offset]); - break; - case R_XTENSA_PDIFF16: - case R_XTENSA_NDIFF16: -+ diff_mask = 0xffff; - diff_value = - bfd_get_16 (abfd, &contents[old_source_offset]); - break; - case R_XTENSA_PDIFF32: - case R_XTENSA_NDIFF32: -+ diff_mask = 0xffffffff; - diff_value = - bfd_get_32 (abfd, &contents[old_source_offset]); - break; - } - - if (r_type >= R_XTENSA_NDIFF8 -- && r_type <= R_XTENSA_NDIFF32) -- diff_value = -diff_value; -+ && r_type <= R_XTENSA_NDIFF32 -+ && diff_value) -+ diff_value |= ~diff_mask; - - new_end_offset = offset_with_removed_text_map - (&target_relax_info->action_list, -@@ -9710,43 +9717,40 @@ relax_section (bfd *abfd, asection *sec, struct bfd_link_info *link_info) - switch (r_type) - { - case R_XTENSA_DIFF8: -- diff_mask = 0x7f; - bfd_put_signed_8 (abfd, diff_value, - &contents[old_source_offset]); - break; - case R_XTENSA_DIFF16: -- diff_mask = 0x7fff; - bfd_put_signed_16 (abfd, diff_value, - &contents[old_source_offset]); - break; - case R_XTENSA_DIFF32: -- diff_mask = 0x7fffffff; - bfd_put_signed_32 (abfd, diff_value, - &contents[old_source_offset]); - break; - case R_XTENSA_PDIFF8: - case R_XTENSA_NDIFF8: -- diff_mask = 0xff; - bfd_put_8 (abfd, diff_value, - &contents[old_source_offset]); - break; - case R_XTENSA_PDIFF16: - case R_XTENSA_NDIFF16: -- diff_mask = 0xffff; - bfd_put_16 (abfd, diff_value, - &contents[old_source_offset]); - break; - case R_XTENSA_PDIFF32: - case R_XTENSA_NDIFF32: -- diff_mask = 0xffffffff; - bfd_put_32 (abfd, diff_value, - &contents[old_source_offset]); - break; - } - -- /* Check for overflow. Sign bits must be all zeroes or all ones */ -- if ((diff_value & ~diff_mask) != 0 && -- (diff_value & ~diff_mask) != (-1 & ~diff_mask)) -+ /* Check for overflow. Sign bits must be all zeroes or -+ all ones. When sign bits are all ones diff_value -+ may not be zero. */ -+ if (((diff_value & ~diff_mask) != 0 -+ && (diff_value & ~diff_mask) != ~diff_mask) -+ || (diff_value && (bfd_vma) diff_value == ~diff_mask)) - { - (*link_info->callbacks->reloc_dangerous) - (link_info, _("overflow after relaxation"), --- -2.20.1 - diff --git a/package/binutils/Config.in.host b/package/binutils/Config.in.host index d857c485d3..8622ebf3f3 100644 --- a/package/binutils/Config.in.host +++ b/package/binutils/Config.in.host @@ -17,13 +17,6 @@ config BR2_BINUTILS_VERSION_2_32_X bool "binutils 2.32" depends on !BR2_csky -config BR2_BINUTILS_VERSION_2_33_X - bool "binutils 2.33.1" - depends on !BR2_csky - # https://github.com/uclinux-dev/elf2flt/pull/16 - # https://github.com/uclinux-dev/elf2flt/issues/12 - depends on !BR2_BINFMT_FLAT - config BR2_BINUTILS_VERSION_2_34_X bool "binutils 2.34" depends on !BR2_csky @@ -60,7 +53,6 @@ config BR2_BINUTILS_VERSION default "arc-2020.09-release" if BR2_BINUTILS_VERSION_ARC default "c66d8bbcebfddf713b2b436e1b135e6b125a55a5" if BR2_BINUTILS_VERSION_CSKY default "2.32" if BR2_BINUTILS_VERSION_2_32_X - default "2.33.1" if BR2_BINUTILS_VERSION_2_33_X default "2.34" if BR2_BINUTILS_VERSION_2_34_X default "2.35.2" if BR2_BINUTILS_VERSION_2_35_X default "2.36" if BR2_BINUTILS_VERSION_2_36_X diff --git a/package/binutils/binutils.hash b/package/binutils/binutils.hash index 35e688a21e..9d48581712 100644 --- a/package/binutils/binutils.hash +++ b/package/binutils/binutils.hash @@ -1,6 +1,5 @@ # From ftp://gcc.gnu.org/pub/binutils/releases/sha512.sum sha512 d326408f12a03d9a61a9de56584c2af12f81c2e50d2d7e835d51565df8314df01575724afa1e43bd0db45cfc9916b41519b67dfce03232aa4978704492a6994a binutils-2.32.tar.xz -sha512 b7a6767c6c7ca6b5cafa7080e6820b7bb3a53b7148348c438d99905defbdf0d30c9744a484ee01c9441a8153901808513366b15ba9533e20c9673c262ade36ac binutils-2.33.1.tar.xz sha512 2c7976939dcf5e8c5b7374cccd39bfe803b1bec73c6abfa0eb17c24e1942574c6bdb874c66a092a82adc443182eacd8a5a8001c19a76101f0c7ba40c27de0bbd binutils-2.34.tar.xz sha512 9974ede5978d32e0d68fef23da48fa00bd06b0bff7ec45b00ca075c126d6bbe0cf2defc03ecc3f17bc6cc85b64271a13009c4049d7ba17de26e84e3a6e2c0348 binutils-2.35.2.tar.xz sha512 0b89b70d4ad5cfe5bd0011dc7e342ae9de96efdbfc3442a0d6b5f7660e38bbcad36f2c72ba8f074323f02bde022ff1cd723ae99f0ea55cf94ee2dbbc0e4efdb2 binutils-2.36.tar.xz From patchwork Sun Jan 31 22:33:03 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Petazzoni X-Patchwork-Id: 1433968 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=busybox.net (client-ip=140.211.166.137; helo=fraxinus.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4DTQpR5wnWz9sWw for ; Mon, 1 Feb 2021 09:33:35 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 3902885888; Sun, 31 Jan 2021 22:33:34 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id ZiecvCTikfUM; Sun, 31 Jan 2021 22:33:33 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by fraxinus.osuosl.org (Postfix) with ESMTP id E3FDC858C9; Sun, 31 Jan 2021 22:33:32 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) by ash.osuosl.org (Postfix) with ESMTP id 579221BF395 for ; Sun, 31 Jan 2021 22:33:22 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id 3EDF087042 for ; Sun, 31 Jan 2021 22:33:22 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 2cRAs70G8qvV for ; Sun, 31 Jan 2021 22:33:20 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from relay12.mail.gandi.net (relay12.mail.gandi.net [217.70.178.232]) by hemlock.osuosl.org (Postfix) with ESMTPS id E0C1E87048 for ; Sun, 31 Jan 2021 22:33:19 +0000 (UTC) Received: from localhost (unknown [185.200.12.8]) (Authenticated sender: thomas.petazzoni@bootlin.com) by relay12.mail.gandi.net (Postfix) with ESMTPSA id 062CD200002; Sun, 31 Jan 2021 22:33:15 +0000 (UTC) From: Thomas Petazzoni To: Buildroot List Date: Sun, 31 Jan 2021 23:33:03 +0100 Message-Id: <20210131223304.1857838-5-thomas.petazzoni@bootlin.com> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210131223304.1857838-1-thomas.petazzoni@bootlin.com> References: <20210131223304.1857838-1-thomas.petazzoni@bootlin.com> MIME-Version: 1.0 Subject: [Buildroot] [PATCH 5/5] package/musl: bump to version 1.2.2 X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Romain Naour , Thomas Petazzoni Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" Drop 0003-rewrite-wcsnrtombs-to-fix-buffer-overflow-and-other-.patch as it is a backport of upstream commit 3ab2a4e02682df1382955071919d8aa3c3ec40d4 which is part of the 1.2.2 release. 1.2.2 release notes major changes: - child restrictions lifted after fork of multithreaded parent new features: - _Fork function (POSIX-future) - reallocarray function (extension from OpenBSD, now widespread) - gettid function (kernel tid as supported concept) - SIGEV_THREAD_ID sigevent API (Linux extension) - tcgetwinsize and tcsetwinsize functions (POSIX-future) performance: - faster software sqrt on archs without native sqrt instruction compatibility: - realpath no longer depends on procfs availability & accuracy - time zone parser now always prefers 64-bit tables if present - crypt_blowfish now supports $2b$ prefix - res_query now reports errors via h_errno - set*id and setrlimit are now safe in vforked/cloned child - setgroups now applies to all threads - dlopen debugger notification is improved, should work with lldb - setrlimit no longer needs __synccall broadcast on linux 2.6.36+ - faccessat with AT_EACCESS no longer needs child process on linux 5.8+ bugs fixed: - buffer overflow and infinite loop errors in wcsnrtombs (CVE-2020-28928) - sem_close unmapped still-referenced semaphores - fork of process with active aio could deadlock or crash paren - pthread_cond_wait was broken with priority-inheritance mutex - getgrouplist wrongly failed when nscd reported an empty list - abort could leak modified SIGABRT disposition to fork or posix_spawn child - regression with mallocng: malloc_usable_size(0) crashed - readlink wrongly gave EINVAL on zero length dest buffer - sqrtl was severely inaccurate (not correctly rounded) on ldquad archs - assert failure wrongly flushed stdio (possible deadlock) - MUSL_LOCPATH search was broken with multiple components - missing newline in herror output - possible deadlock in pthread_exit with pshared mutex or barrier usage - pthread_mutexattr_getprotocol didn't read back protocol - v4l2 ioctl translation for pre-time64 kernels didn't work arch-specific bugs fixed: - x86_64 longjmp failed to handle 0 argument reliably - i386 __set_thread_area fallback for pre-2.6 kernels didn't work - missing O_LARGEFILE macro value on x86_64, x32, mips64 - unpredictable s390x breakage from failure to preserve call-saved registers Signed-off-by: Thomas Petazzoni --- ...bs-to-fix-buffer-overflow-and-other-.patch | 114 ------------------ package/musl/musl.hash | 4 +- package/musl/musl.mk | 2 +- 3 files changed, 3 insertions(+), 117 deletions(-) delete mode 100644 package/musl/0003-rewrite-wcsnrtombs-to-fix-buffer-overflow-and-other-.patch diff --git a/package/musl/0003-rewrite-wcsnrtombs-to-fix-buffer-overflow-and-other-.patch b/package/musl/0003-rewrite-wcsnrtombs-to-fix-buffer-overflow-and-other-.patch deleted file mode 100644 index 2fb29940a9..0000000000 --- a/package/musl/0003-rewrite-wcsnrtombs-to-fix-buffer-overflow-and-other-.patch +++ /dev/null @@ -1,114 +0,0 @@ -From 3ab2a4e02682df1382955071919d8aa3c3ec40d4 Mon Sep 17 00:00:00 2001 -From: Rich Felker -Date: Thu, 19 Nov 2020 17:12:43 -0500 -Subject: [PATCH] rewrite wcsnrtombs to fix buffer overflow and other bugs - -the original wcsnrtombs implementation, which has been largely -untouched since 0.5.0, attempted to build input-length-limiting -conversion on top of wcsrtombs, which only limits output length. as -best I recall, this choice was made out of a mix of disdain over -having yet another variant function to implement (added in POSIX 2008; -not standard C) and preference not to switch things around and -implement the wcsrtombs in terms of the more general new function, -probably over namespace issues. the strategy employed was to impose -output limits that would ensure the input limit wasn't exceeded, then -finish up the tail character-at-a-time. unfortunately, none of that -worked correctly. - -first, the logic in the wcsrtombs loop was wrong in that it could -easily get stuck making no forward progress, by imposing an output -limit too small to convert even one character. - -the character-at-a-time loop that followed was even worse. it made no -effort to ensure that the converted multibyte character would fit in -the remaining output space, only that there was a nonzero amount of -output space remaining. it also employed an incorrect interpretation -of wcrtomb's interface contract for converting the null character, -thereby failing to act on end of input, and remaining space accounting -was subject to unsigned wrap-around. together these errors allow -unbounded overflow of the destination buffer, controlled by input -length limit and input wchar_t string contents. - -given the extent to which this function was broken, it's plausible -that most applications that would have been rendered exploitable were -sufficiently broken not to be usable in the first place. however, it's -also plausible that common (especially ASCII-only) inputs succeeded in -the wcsrtombs loop, which mostly worked, while leaving the wildly -erroneous code in the second loop exposed to particular non-ASCII -inputs. - -CVE-2020-28928 has been assigned for this issue. - -Signed-off-by: Peter Korsgaard ---- - src/multibyte/wcsnrtombs.c | 46 ++++++++++++++++---------------------- - 1 file changed, 19 insertions(+), 27 deletions(-) - -diff --git a/src/multibyte/wcsnrtombs.c b/src/multibyte/wcsnrtombs.c -index 676932b5..95e25e70 100644 ---- a/src/multibyte/wcsnrtombs.c -+++ b/src/multibyte/wcsnrtombs.c -@@ -1,41 +1,33 @@ - #include -+#include -+#include - - size_t wcsnrtombs(char *restrict dst, const wchar_t **restrict wcs, size_t wn, size_t n, mbstate_t *restrict st) - { -- size_t l, cnt=0, n2; -- char *s, buf[256]; - const wchar_t *ws = *wcs; -- const wchar_t *tmp_ws; -- -- if (!dst) s = buf, n = sizeof buf; -- else s = dst; -- -- while ( ws && n && ( (n2=wn)>=n || n2>32 ) ) { -- if (n2>=n) n2=n; -- tmp_ws = ws; -- l = wcsrtombs(s, &ws, n2, 0); -- if (!(l+1)) { -- cnt = l; -- n = 0; -+ size_t cnt = 0; -+ if (!dst) n=0; -+ while (ws && wn) { -+ char tmp[MB_LEN_MAX]; -+ size_t l = wcrtomb(nn) break; -+ memcpy(dst, tmp, l); -+ } -+ dst += l; - n -= l; - } -- wn = ws ? wn - (ws - tmp_ws) : 0; -- cnt += l; -- } -- if (ws) while (n && wn) { -- l = wcrtomb(s, *ws, 0); -- if ((l+1)<=1) { -- if (!l) ws = 0; -- else cnt = l; -+ if (!*ws) { -+ ws = 0; - break; - } -- ws++; wn--; -- /* safe - this loop runs fewer than sizeof(buf) times */ -- s+=l; n-=l; -+ ws++; -+ wn--; - cnt += l; - } - if (dst) *wcs = ws; --- -2.20.1 - diff --git a/package/musl/musl.hash b/package/musl/musl.hash index 39f1057961..4ab18cebd8 100644 --- a/package/musl/musl.hash +++ b/package/musl/musl.hash @@ -1,4 +1,4 @@ # Locally calculated after checking pgp signature from -# https://musl.libc.org/releases/musl-1.2.1.tar.gz.asc -sha256 68af6e18539f646f9c41a3a2bb25be4a5cfa5a8f65f0bb647fd2bbfdf877e84b musl-1.2.1.tar.gz +# https://musl.libc.org/releases/musl-1.2.2.tar.gz.asc +sha256 9b969322012d796dc23dda27a35866034fa67d8fb67e0e2c45c913c3d43219dd musl-1.2.2.tar.gz sha256 f9bc4423732350eb0b3f7ed7e91d530298476f8fec0c6c427a1c04ade22655af COPYRIGHT diff --git a/package/musl/musl.mk b/package/musl/musl.mk index bc4237968d..82b3eeaf52 100644 --- a/package/musl/musl.mk +++ b/package/musl/musl.mk @@ -4,7 +4,7 @@ # ################################################################################ -MUSL_VERSION = 1.2.1 +MUSL_VERSION = 1.2.2 MUSL_SITE = http://www.musl-libc.org/releases MUSL_LICENSE = MIT MUSL_LICENSE_FILES = COPYRIGHT