Browse Source

gcc: update 11 minor version

- Update 11 minor version to match the upstream
- Rename patches dir to reflect new gcc 11 minor version
- Drop upstream patch

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
(cherry picked from commit 4db8466a14)
lilik-openwrt-22.03
Christian Marangi 2 years ago
committed by Rosen Penev
parent
commit
5651f6a3ee
23 changed files with 8 additions and 195 deletions
  1. +2
    -2
      devel/gcc/Makefile
  2. +0
    -114
      devel/gcc/patches/11.2.0/001-v11.3.0-ranger-Fix-up-fold_using_range-range_of_address-PR10.patch
  3. +0
    -73
      devel/gcc/patches/11.2.0/980-add-nostdinc++.patch
  4. +0
    -0
      devel/gcc/patches/11.3.0/002-case_insensitive.patch
  5. +0
    -0
      devel/gcc/patches/11.3.0/003-dont-choke-when-building-32bit-on-64bit.patch
  6. +1
    -1
      devel/gcc/patches/11.3.0/010-documentation.patch
  7. +2
    -2
      devel/gcc/patches/11.3.0/011-v12-configure-define-TARGET_LIBC_GNUSTACK-on-musl.patch
  8. +0
    -0
      devel/gcc/patches/11.3.0/110-Fix-MIPS-PR-84790.patch
  9. +0
    -0
      devel/gcc/patches/11.3.0/230-musl_libssp.patch
  10. +0
    -0
      devel/gcc/patches/11.3.0/300-mips_Os_cpu_rtx_cost_model.patch
  11. +0
    -0
      devel/gcc/patches/11.3.0/810-arm-softfloat-libgcc.patch
  12. +0
    -0
      devel/gcc/patches/11.3.0/820-libgcc_pic.patch
  13. +0
    -0
      devel/gcc/patches/11.3.0/840-armv4_pass_fix-v4bx_to_ld.patch
  14. +0
    -0
      devel/gcc/patches/11.3.0/850-use_shared_libgcc.patch
  15. +0
    -0
      devel/gcc/patches/11.3.0/851-libgcc_no_compat.patch
  16. +0
    -0
      devel/gcc/patches/11.3.0/870-ppc_no_crtsavres.patch
  17. +0
    -0
      devel/gcc/patches/11.3.0/881-no_tm_section.patch
  18. +0
    -0
      devel/gcc/patches/11.3.0/900-bad-mips16-crt.patch
  19. +2
    -2
      devel/gcc/patches/11.3.0/910-mbsd_multi.patch
  20. +1
    -1
      devel/gcc/patches/11.3.0/920-specs_nonfatal_getenv.patch
  21. +0
    -0
      devel/gcc/patches/11.3.0/931-libffi-fix-MIPS-softfloat-build-issue.patch
  22. +0
    -0
      devel/gcc/patches/11.3.0/960-gotools-fix-compilation-when-making-cross-compiler.patch
  23. +0
    -0
      devel/gcc/patches/11.3.0/970-macos_arm64-building-fix.patch

+ 2
- 2
devel/gcc/Makefile View File

@ -42,8 +42,8 @@ ifeq ($(PKG_VERSION),10.3.0)
PKG_HASH:=64f404c1a650f27fc33da242e1f2df54952e3963a49e06e73f6940f3223ac344
endif
ifeq ($(PKG_VERSION),11.2.0)
PKG_HASH:=d08edc536b54c372a1010ff6619dd274c0f1603aa49212ba20f7aa2cda36fa8b
ifeq ($(PKG_VERSION),11.3.0)
PKG_HASH:=b47cf2818691f5b1e21df2bb38c795fac2cfbd640ede2d0a5e1c89e338a3ac39
endif
PATCH_DIR=./patches/$(GCC_VERSION)


+ 0
- 114
devel/gcc/patches/11.2.0/001-v11.3.0-ranger-Fix-up-fold_using_range-range_of_address-PR10.patch View File

@ -1,114 +0,0 @@
From a6219e8e0719b14f474b0dcaa7bde2f4e57474f9 Mon Sep 17 00:00:00 2001
From: Jakub Jelinek <jakub@redhat.com>
Date: Wed, 17 Nov 2021 13:45:53 +0100
Subject: [PATCH] ranger: Fix up fold_using_range::range_of_address [PR103255]
If on &base->member the offset isn't constant or isn't zero and
-fdelete-null-pointer-checks and not -fwrapv-pointer and base has a range
that doesn't include NULL, we return the range of the base.
Usually it isn't a big deal, because for most pointers we just use
varying, range_zero and range_nonzero ranges and nothing beyond that,
but if a pointer is initialized from a constant, we actually track the
exact range and in that case this causes miscompilation.
As discussed on IRC, I think doing something like:
offset_int off2;
if (off_cst && off.is_constant (&off2))
{
tree cst = wide_int_to_tree (sizetype, off2 / BITS_PER_UNIT);
// adjust range r with POINTER_PLUS_EXPR cst
if (!range_includes_zero_p (&r))
return true;
}
// Fallback
r = range_nonzero (TREE_TYPE (gimple_assign_rhs1 (stmt)));
return true;
could work, given that most of the pointer ranges are just the simple ones
perhaps it is too much for little benefit.
2021-11-17 Jakub Jelinek <jakub@redhat.com>
PR tree-optimization/103255
* gimple-range.cc (fold_using_range::range_of_address): Return
range_nonzero rather than unadjusted base's range. Formatting fixes.
* gcc.c-torture/execute/pr103255.c: New test.
(cherry picked from commit c39cb6bf835ca12e590eaa6f90222e51be207c50)
---
gcc/gimple-range.cc | 16 +++++---
.../gcc.c-torture/execute/pr103255.c | 41 +++++++++++++++++++
2 files changed, 52 insertions(+), 5 deletions(-)
create mode 100644 gcc/testsuite/gcc.c-torture/execute/pr103255.c
--- a/gcc/gimple-range.cc
+++ b/gcc/gimple-range.cc
@@ -491,14 +491,20 @@ gimple_ranger::range_of_address (irange
}
/* If &X->a is equal to X, the range of X is the result. */
if (off_cst && known_eq (off, 0))
- return true;
+ return true;
else if (flag_delete_null_pointer_checks
&& !TYPE_OVERFLOW_WRAPS (TREE_TYPE (expr)))
{
- /* For -fdelete-null-pointer-checks -fno-wrapv-pointer we don't
- allow going from non-NULL pointer to NULL. */
- if(!range_includes_zero_p (&r))
- return true;
+ /* For -fdelete-null-pointer-checks -fno-wrapv-pointer we don't
+ allow going from non-NULL pointer to NULL. */
+ if (!range_includes_zero_p (&r))
+ {
+ /* We could here instead adjust r by off >> LOG2_BITS_PER_UNIT
+ using POINTER_PLUS_EXPR if off_cst and just fall back to
+ this. */
+ r = range_nonzero (TREE_TYPE (gimple_assign_rhs1 (stmt)));
+ return true;
+ }
}
/* If MEM_REF has a "positive" offset, consider it non-NULL
always, for -fdelete-null-pointer-checks also "negative"
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/execute/pr103255.c
@@ -0,0 +1,41 @@
+/* PR tree-optimization/103255 */
+
+struct H
+{
+ unsigned a;
+ unsigned b;
+ unsigned c;
+};
+
+#if __SIZEOF_POINTER__ >= 4
+#define ADDR 0x400000
+#else
+#define ADDR 0x4000
+#endif
+#define OFF 0x20
+
+int
+main ()
+{
+ struct H *h = 0;
+ unsigned long o;
+ volatile int t = 1;
+
+ for (o = OFF; o <= OFF; o += 0x1000)
+ {
+ struct H *u;
+ u = (struct H *) (ADDR + o);
+ if (t)
+ {
+ h = u;
+ break;
+ }
+ }
+
+ if (h == 0)
+ return 0;
+ unsigned *tt = &h->b;
+ if ((__SIZE_TYPE__) tt != (ADDR + OFF + __builtin_offsetof (struct H, b)))
+ __builtin_abort ();
+ return 0;
+}

+ 0
- 73
devel/gcc/patches/11.2.0/980-add-nostdinc++.patch View File

@ -1,73 +0,0 @@
From: Jonathan Wakely <jwakely@redhat.com>
Date: Fri, 7 Jan 2022 15:21:03 +0000 (+0000)
Subject: libstdc++: Add -nostdinc++ for c++17 sources [PR100017]
X-Git-Tag: releases/gcc-11.3.0~445
X-Git-Url: https://gcc.gnu.org/git/?p=gcc.git;a=commitdiff_plain;h=01a70ccd723eb9a479186fe37c972b0d0f8676cf
libstdc++: Add -nostdinc++ for c++17 sources [PR100017]
When building a build!=host compiler, the just-built gcc can't be used
to build the target libstdc++ (because it is built for the host triplet,
not the build triplet). The top-level configure.ac sets up the build
flags for libstdc++ (and other "raw_cxx" libs) like this:
GCC_TARGET_TOOL(c++ for libstdc++, RAW_CXX_FOR_TARGET, CXX,
[gcc/xgcc -shared-libgcc -B$$r/$(HOST_SUBDIR)/gcc -nostdinc++ -L$$r/$(TARGET_SUBDIR)/libstdc++-v3/src -L$$r/$(TARGET_SUBDIR)/libstdc++-v3/src/.libs -L$$r/$(TARGET_SUBDIR)/libstdc++-v3/libsupc++/.libs],
c++)
The -nostdinc++ flag is only used for the IN-TREE-TOOL, i.e. when using
the just-built gcc/xgcc compiler. This means that the cross-compiler
used to build libstdc++ will add its own libstdc++ headers to the
include path. That results in the #include <cfenv> in
src/c++17/floating_to_chars.cc and src/c++17/floating_from_chars.cc
doing #include_next <fenv.h> and finding the libstdc++ fenv.h wrapper
from the host compiler. Because that has the same include guard as the
<fenv.h> in the libstdc++ we're trying to build, we never reach the
underlying <fenv.h> from libc. That results in several errors of the
form:
error: 'fenv_t' has not been declared in '::'
The most correct fix would be to add -nostdinc++ to the
RAW_CXX_FOR_TARGET variable in configure.ac, or the
RAW_CXX_TARGET_EXPORTS variable in Makefile.tpl.
Another solution would be to make the libstdc++ <fenv.h> wrapper use
_GLIBCXX_INCLUDE_NEXT_C_HEADERS like our <stdlib.h> and other C header
wrappers.
For now though, the simplest and safest solution is to just add
-nostdinc++ to the CXXFLAGS used for src/c++17/*.cc, which is what this
does.
libstdc++-v3/ChangeLog:
PR libstdc++/100017
* src/c++17/Makefile.am (AM_CXXFLAGS): Add -nostdinc++.
* src/c++17/Makefile.in: Regenerate.
(cherry picked from commit 4fde88e5dd152fe866a97b12e0f8229970d15cb3)
---
--- a/libstdc++-v3/src/c++17/Makefile.am
+++ b/libstdc++-v3/src/c++17/Makefile.am
@@ -79,7 +79,7 @@ endif
# OPTIMIZE_CXXFLAGS on the compile line so that -O2 can be overridden
# as the occasion calls for it.
AM_CXXFLAGS = \
- -std=gnu++17 \
+ -std=gnu++17 -nostdinc++ \
$(glibcxx_lt_pic_flag) $(glibcxx_compiler_shared_flag) \
$(XTEMPLATE_FLAGS) $(VTV_CXXFLAGS) \
$(WARN_CXXFLAGS) $(OPTIMIZE_CXXFLAGS) $(CONFIG_CXXFLAGS) \
--- a/libstdc++-v3/src/c++17/Makefile.in
+++ b/libstdc++-v3/src/c++17/Makefile.in
@@ -455,7 +455,7 @@ libc__17convenience_la_SOURCES = $(sourc
# OPTIMIZE_CXXFLAGS on the compile line so that -O2 can be overridden
# as the occasion calls for it.
AM_CXXFLAGS = \
- -std=gnu++17 \
+ -std=gnu++17 -nostdinc++ \
$(glibcxx_lt_pic_flag) $(glibcxx_compiler_shared_flag) \
$(XTEMPLATE_FLAGS) $(VTV_CXXFLAGS) \
$(WARN_CXXFLAGS) $(OPTIMIZE_CXXFLAGS) $(CONFIG_CXXFLAGS) \

devel/gcc/patches/11.2.0/002-case_insensitive.patch → devel/gcc/patches/11.3.0/002-case_insensitive.patch View File


devel/gcc/patches/11.2.0/003-dont-choke-when-building-32bit-on-64bit.patch → devel/gcc/patches/11.3.0/003-dont-choke-when-building-32bit-on-64bit.patch View File


devel/gcc/patches/11.2.0/010-documentation.patch → devel/gcc/patches/11.3.0/010-documentation.patch View File


devel/gcc/patches/11.2.0/011-v12-configure-define-TARGET_LIBC_GNUSTACK-on-musl.patch → devel/gcc/patches/11.3.0/011-v12-configure-define-TARGET_LIBC_GNUSTACK-on-musl.patch View File


devel/gcc/patches/11.2.0/110-Fix-MIPS-PR-84790.patch → devel/gcc/patches/11.3.0/110-Fix-MIPS-PR-84790.patch View File


devel/gcc/patches/11.2.0/230-musl_libssp.patch → devel/gcc/patches/11.3.0/230-musl_libssp.patch View File


devel/gcc/patches/11.2.0/300-mips_Os_cpu_rtx_cost_model.patch → devel/gcc/patches/11.3.0/300-mips_Os_cpu_rtx_cost_model.patch View File


devel/gcc/patches/11.2.0/810-arm-softfloat-libgcc.patch → devel/gcc/patches/11.3.0/810-arm-softfloat-libgcc.patch View File


devel/gcc/patches/11.2.0/820-libgcc_pic.patch → devel/gcc/patches/11.3.0/820-libgcc_pic.patch View File


devel/gcc/patches/11.2.0/840-armv4_pass_fix-v4bx_to_ld.patch → devel/gcc/patches/11.3.0/840-armv4_pass_fix-v4bx_to_ld.patch View File


devel/gcc/patches/11.2.0/850-use_shared_libgcc.patch → devel/gcc/patches/11.3.0/850-use_shared_libgcc.patch View File


devel/gcc/patches/11.2.0/851-libgcc_no_compat.patch → devel/gcc/patches/11.3.0/851-libgcc_no_compat.patch View File


devel/gcc/patches/11.2.0/870-ppc_no_crtsavres.patch → devel/gcc/patches/11.3.0/870-ppc_no_crtsavres.patch View File


devel/gcc/patches/11.2.0/881-no_tm_section.patch → devel/gcc/patches/11.3.0/881-no_tm_section.patch View File


devel/gcc/patches/11.2.0/900-bad-mips16-crt.patch → devel/gcc/patches/11.3.0/900-bad-mips16-crt.patch View File


devel/gcc/patches/11.2.0/910-mbsd_multi.patch → devel/gcc/patches/11.3.0/910-mbsd_multi.patch View File


devel/gcc/patches/11.2.0/920-specs_nonfatal_getenv.patch → devel/gcc/patches/11.3.0/920-specs_nonfatal_getenv.patch View File


devel/gcc/patches/11.2.0/931-libffi-fix-MIPS-softfloat-build-issue.patch → devel/gcc/patches/11.3.0/931-libffi-fix-MIPS-softfloat-build-issue.patch View File


devel/gcc/patches/11.2.0/960-gotools-fix-compilation-when-making-cross-compiler.patch → devel/gcc/patches/11.3.0/960-gotools-fix-compilation-when-making-cross-compiler.patch View File


devel/gcc/patches/11.2.0/970-macos_arm64-building-fix.patch → devel/gcc/patches/11.3.0/970-macos_arm64-building-fix.patch View File


Loading…
Cancel
Save