Skip to content

Commit

Permalink
gh-38008: gcc, gfortran: Update to 13.2.0; remove `debian-buster-…
Browse files Browse the repository at this point in the history
…gcc_spkg` from CI

    
<!-- ^ Please provide a concise and informative title. -->
<!-- ^ Don't put issue numbers in the title, do this in the PR
description below. -->
<!-- ^ For example, instead of "Fixes #12345" use "Introduce new method
to calculate 1 + 2". -->
<!-- v Describe your changes below in detail. -->
<!-- v Why is this change required? What problem does it solve? -->
<!-- v If this PR resolves an open issue, please link to it here. For
example, "Fixes #12345". -->

- Fixes #38006 @jhpalmieri
- `gcc` does not build on `debian-buster` (which we supported via
`-gcc_spkg` because it is LTS until 2024-06), so we drop this platform
now; see #32074.

### 📝 Checklist

<!-- Put an `x` in all the boxes that apply. -->

- [x] The title is concise and informative.
- [x] The description explains in detail what this PR is about.
- [x] I have linked a relevant issue or discussion.
- [ ] I have created tests covering the changes.
- [ ] I have updated the documentation and checked the documentation
preview.

### ⌛ Dependencies

<!-- List all open PRs that this PR logically depends on. For example,
-->
<!-- - #12345: short description why this is a dependency -->
<!-- - #34567: ... -->

- Depends on #37726 (merged here to resolve merge conflict)
    
URL: #38008
Reported by: Matthias Köppe
Reviewer(s):
  • Loading branch information
Release Manager committed May 23, 2024
2 parents 74f244c + 4187f5c commit aa6f8a7
Show file tree
Hide file tree
Showing 16 changed files with 5,576 additions and 7,812 deletions.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

1 change: 0 additions & 1 deletion .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ on:
"ubuntu-lunar",
"ubuntu-mantic",
"ubuntu-noble",
"debian-buster-gcc_spkg",
"debian-bullseye",
"debian-bookworm",
"debian-trixie",
Expand Down
4 changes: 2 additions & 2 deletions build/pkgs/gcc/checksums.ini
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
tarball=gcc-VERSION.tar.xz
sha1=5dce6dc0091b8049b530d1587513a07201691760
sha256=e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
sha1=5f95b6d042fb37d45c6cbebfc91decfbc4fb493c
sha256=e275e76442a6067341a27f04c5c6b83d8613144004c0413528863dc6b5c743da
upstream_url=https://mirrors.kernel.org/gnu/gcc/gcc-VERSION/gcc-VERSION.tar.xz
2 changes: 1 addition & 1 deletion build/pkgs/gcc/package-version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
12.2.0
13.2.0
138 changes: 138 additions & 0 deletions build/pkgs/gcc/patches/68057560ff1fc0fb2df38c2f9627a20c9a8da5c5.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,138 @@
From: Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
Date: Thu, 7 Mar 2024 13:36:03 +0000 (+0100)
Subject: Include safe-ctype.h after C++ standard headers, to avoid over-poisoning
X-Git-Url: https://gcc.gnu.org/git/?p=gcc.git;a=commitdiff_plain;h=68057560ff1fc0fb2df38c2f9627a20c9a8da5c5

Include safe-ctype.h after C++ standard headers, to avoid over-poisoning

When building gcc's C++ sources against recent libc++, the poisoning of
the ctype macros due to including safe-ctype.h before including C++
standard headers such as <list>, <map>, etc, causes many compilation
errors, similar to:

In file included from /home/dim/src/gcc/master/gcc/gensupport.cc:23:
In file included from /home/dim/src/gcc/master/gcc/system.h:233:
In file included from /usr/include/c++/v1/vector:321:
In file included from
/usr/include/c++/v1/__format/formatter_bool.h:20:
In file included from
/usr/include/c++/v1/__format/formatter_integral.h:32:
In file included from /usr/include/c++/v1/locale:202:
/usr/include/c++/v1/__locale:546:5: error: '__abi_tag__' attribute
only applies to structs, variables, functions, and namespaces
546 | _LIBCPP_INLINE_VISIBILITY
| ^
/usr/include/c++/v1/__config:813:37: note: expanded from macro
'_LIBCPP_INLINE_VISIBILITY'
813 | # define _LIBCPP_INLINE_VISIBILITY _LIBCPP_HIDE_FROM_ABI
| ^
/usr/include/c++/v1/__config:792:26: note: expanded from macro
'_LIBCPP_HIDE_FROM_ABI'
792 |
__attribute__((__abi_tag__(_LIBCPP_TOSTRING(
_LIBCPP_VERSIONED_IDENTIFIER))))
| ^
In file included from /home/dim/src/gcc/master/gcc/gensupport.cc:23:
In file included from /home/dim/src/gcc/master/gcc/system.h:233:
In file included from /usr/include/c++/v1/vector:321:
In file included from
/usr/include/c++/v1/__format/formatter_bool.h:20:
In file included from
/usr/include/c++/v1/__format/formatter_integral.h:32:
In file included from /usr/include/c++/v1/locale:202:
/usr/include/c++/v1/__locale:547:37: error: expected ';' at end of
declaration list
547 | char_type toupper(char_type __c) const
| ^
/usr/include/c++/v1/__locale:553:48: error: too many arguments
provided to function-like macro invocation
553 | const char_type* toupper(char_type* __low, const
char_type* __high) const
| ^
/home/dim/src/gcc/master/gcc/../include/safe-ctype.h:146:9: note:
macro 'toupper' defined here
146 | #define toupper(c) do_not_use_toupper_with_safe_ctype
| ^

This is because libc++ uses different transitive includes than
libstdc++, and some of those transitive includes pull in various ctype
declarations (typically via <locale>).

There was already a special case for including <string> before
safe-ctype.h, so move the rest of the C++ standard header includes to
the same location, to fix the problem.

PR middle-end/111632

gcc/ChangeLog:

* system.h: Include safe-ctype.h after C++ standard headers.

Signed-off-by: Dimitry Andric <dimitry@andric.com>
(cherry picked from commit 9970b576b7e4ae337af1268395ff221348c4b34a)
---

diff --git a/gcc/system.h b/gcc/system.h
index 33e9d4211150..03ab33ac960f 100644
--- a/gcc/system.h
+++ b/gcc/system.h
@@ -194,27 +194,8 @@ extern int fprintf_unlocked (FILE *, const char *, ...);
#undef fread_unlocked
#undef fwrite_unlocked

-/* Include <string> before "safe-ctype.h" to avoid GCC poisoning
- the ctype macros through safe-ctype.h */
-
-#ifdef __cplusplus
-#ifdef INCLUDE_STRING
-# include <string>
-#endif
-#endif
-
-/* There are an extraordinary number of issues with <ctype.h>.
- The last straw is that it varies with the locale. Use libiberty's
- replacement instead. */
-#include "safe-ctype.h"
-
-#include <sys/types.h>
-
-#include <errno.h>
-
-#if !defined (errno) && defined (HAVE_DECL_ERRNO) && !HAVE_DECL_ERRNO
-extern int errno;
-#endif
+/* Include C++ standard headers before "safe-ctype.h" to avoid GCC
+ poisoning the ctype macros through safe-ctype.h */

#ifdef __cplusplus
#if defined (INCLUDE_ALGORITHM) || !defined (HAVE_SWAP_IN_UTILITY)
@@ -229,6 +210,9 @@ extern int errno;
#ifdef INCLUDE_SET
# include <set>
#endif
+#ifdef INCLUDE_STRING
+# include <string>
+#endif
#ifdef INCLUDE_VECTOR
# include <vector>
#endif
@@ -245,6 +229,19 @@ extern int errno;
# include <type_traits>
#endif

+/* There are an extraordinary number of issues with <ctype.h>.
+ The last straw is that it varies with the locale. Use libiberty's
+ replacement instead. */
+#include "safe-ctype.h"
+
+#include <sys/types.h>
+
+#include <errno.h>
+
+#if !defined (errno) && defined (HAVE_DECL_ERRNO) && !HAVE_DECL_ERRNO
+extern int errno;
+#endif
+
/* Some of glibc's string inlines cause warnings. Plus we'd rather
rely on (and therefore test) GCC's string builtins. */
#define __NO_STRING_INLINES
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
From: Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
Date: Sat, 16 Mar 2024 08:50:00 +0000 (+0100)
Subject: libcc1: fix <vector> include
X-Git-Url: https://gcc.gnu.org/git/?p=gcc.git;a=commitdiff_plain;h=e95ab9e60ce1d9aa7751d79291133fd5af9209d7

libcc1: fix <vector> include

Use INCLUDE_VECTOR before including system.h, instead of directly
including <vector>, to avoid running into poisoned identifiers.

Signed-off-by: Dimitry Andric <dimitry@andric.com>

PR middle-end/111632

libcc1/ChangeLog:

* libcc1plugin.cc: Fix include.
* libcp1plugin.cc: Fix include.

(cherry picked from commit 5213047b1d50af63dfabb5e5649821a6cb157e33)
---

diff --git a/libcc1/libcc1plugin.cc b/libcc1/libcc1plugin.cc
index 7e0fecae1456..44bcf56698ee 100644
--- a/libcc1/libcc1plugin.cc
+++ b/libcc1/libcc1plugin.cc
@@ -32,6 +32,7 @@
#undef PACKAGE_VERSION

#define INCLUDE_MEMORY
+#define INCLUDE_VECTOR
#include "gcc-plugin.h"
#include "system.h"
#include "coretypes.h"
@@ -69,8 +70,6 @@
#include "gcc-c-interface.h"
#include "context.hh"

-#include <vector>
-
using namespace cc1_plugin;


diff --git a/libcc1/libcp1plugin.cc b/libcc1/libcp1plugin.cc
index 8d394c0cfdb8..9586a2afdb47 100644
--- a/libcc1/libcp1plugin.cc
+++ b/libcc1/libcp1plugin.cc
@@ -33,6 +33,7 @@
#undef PACKAGE_VERSION

#define INCLUDE_MEMORY
+#define INCLUDE_VECTOR
#include "gcc-plugin.h"
#include "system.h"
#include "coretypes.h"
@@ -71,8 +72,6 @@
#include "rpc.hh"
#include "context.hh"

-#include <vector>
-
using namespace cc1_plugin;


71 changes: 71 additions & 0 deletions build/pkgs/gcc/patches/gcc-13-homebrew.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
Patch included in https://github.com/Homebrew/homebrew-core/blob/50d9d78a4a09b42807b0a8f74f1f2f8933051a7b/Formula/g/gcc@13.rb

diff --git a/fixincludes/fixincl.x b/fixincludes/fixincl.x
index 416d2c2e3a4..e52f11d8460 100644
--- a/fixincludes/fixincl.x
+++ b/fixincludes/fixincl.x
@@ -2,11 +2,11 @@
*
* DO NOT EDIT THIS FILE (fixincl.x)
*
- * It has been AutoGen-ed January 22, 2023 at 09:03:29 PM by AutoGen 5.18.12
+ * It has been AutoGen-ed August 17, 2023 at 10:16:38 AM by AutoGen 5.18.12
* From the definitions inclhack.def
* and the template file fixincl
*/
-/* DO NOT SVN-MERGE THIS FILE, EITHER Sun Jan 22 21:03:29 CET 2023
+/* DO NOT SVN-MERGE THIS FILE, EITHER Thu Aug 17 10:16:38 CEST 2023
*
* You must regenerate it. Use the ./genfixes script.
*
@@ -3674,7 +3674,7 @@ tSCC* apzDarwin_Flt_Eval_MethodMachs[] = {
* content selection pattern - do fix if pattern found
*/
tSCC zDarwin_Flt_Eval_MethodSelect0[] =
- "^#if __FLT_EVAL_METHOD__ == 0$";
+ "^#if __FLT_EVAL_METHOD__ == 0( \\|\\| __FLT_EVAL_METHOD__ == -1)?$";

#define DARWIN_FLT_EVAL_METHOD_TEST_CT 1
static tTestDesc aDarwin_Flt_Eval_MethodTests[] = {
@@ -3685,7 +3685,7 @@ static tTestDesc aDarwin_Flt_Eval_MethodTests[] = {
*/
static const char* apzDarwin_Flt_Eval_MethodPatch[] = {
"format",
- "#if __FLT_EVAL_METHOD__ == 0 || __FLT_EVAL_METHOD__ == 16",
+ "%0 || __FLT_EVAL_METHOD__ == 16",
(char*)NULL };

/* * * * * * * * * * * * * * * * * * * * * * * * * *
diff --git a/fixincludes/inclhack.def b/fixincludes/inclhack.def
index 45e0cbc0c10..19e0ea2df66 100644
--- a/fixincludes/inclhack.def
+++ b/fixincludes/inclhack.def
@@ -1819,10 +1819,11 @@ fix = {
hackname = darwin_flt_eval_method;
mach = "*-*-darwin*";
files = math.h;
- select = "^#if __FLT_EVAL_METHOD__ == 0$";
+ select = "^#if __FLT_EVAL_METHOD__ == 0( \\|\\| __FLT_EVAL_METHOD__ == -1)?$";
c_fix = format;
- c_fix_arg = "#if __FLT_EVAL_METHOD__ == 0 || __FLT_EVAL_METHOD__ == 16";
- test_text = "#if __FLT_EVAL_METHOD__ == 0";
+ c_fix_arg = "%0 || __FLT_EVAL_METHOD__ == 16";
+ test_text = "#if __FLT_EVAL_METHOD__ == 0\n"
+ "#if __FLT_EVAL_METHOD__ == 0 || __FLT_EVAL_METHOD__ == -1";
};

/*
diff --git a/fixincludes/tests/base/math.h b/fixincludes/tests/base/math.h
index 29b67579748..7b92f29a409 100644
--- a/fixincludes/tests/base/math.h
+++ b/fixincludes/tests/base/math.h
@@ -32,6 +32,7 @@

#if defined( DARWIN_FLT_EVAL_METHOD_CHECK )
#if __FLT_EVAL_METHOD__ == 0 || __FLT_EVAL_METHOD__ == 16
+#if __FLT_EVAL_METHOD__ == 0 || __FLT_EVAL_METHOD__ == -1 || __FLT_EVAL_METHOD__ == 16
#endif /* DARWIN_FLT_EVAL_METHOD_CHECK */


--
2.39.3
Loading

0 comments on commit aa6f8a7

Please sign in to comment.