Ports/gcc: Update to version 12.1.0

This commit is contained in:
Daniel Bertalan 2022-05-07 18:31:52 +02:00 committed by Andreas Kling
parent 6cf260c7af
commit 0aee2abda7
5 changed files with 7 additions and 6529 deletions

View file

@ -57,7 +57,7 @@ Please make sure to keep this list up to date when adding and updating ports. :^
| [`frotz`](frotz/) | Frotz | 2.53 | https://gitlab.com/DavidGriffith/frotz |
| [`gawk`](gawk/) | GNU awk | 5.1.1 | https://www.gnu.org/software/gawk/ |
| [`gdb`](gdb/) | GNU Project Debugger | 11.2 | https://sourceware.org/gdb |
| [`gcc`](gcc/) | GNU Compiler Collection | 11.2.0 | https://gcc.gnu.org/ |
| [`gcc`](gcc/) | GNU Compiler Collection | 12.1.0 | https://gcc.gnu.org/ |
| [`genemu`](genemu/) | Genesis / MegaDrive Emulator | e39f690 | https://github.com/rasky/genemu |
| [`gettext`](gettext/) | GNU gettext | 0.21 | https://www.gnu.org/software/gettext/ |
| [`git`](git/) | Git | 2.36.0 | https://git-scm.com/ |

View file

@ -1,9 +1,9 @@
#!/usr/bin/env -S bash ../.port_include.sh
port=gcc
version=11.2.0
version=12.1.0
useconfigure=true
configopts=("--target=${SERENITY_ARCH}-pc-serenity" "--with-sysroot=/" "--with-build-sysroot=${SERENITY_INSTALL_ROOT}" "--with-newlib" "--enable-languages=c,c++" "--disable-lto" "--disable-nls" "--enable-shared" "--enable-default-pie" "--enable-host-shared" "--enable-threads=posix" "--enable-initfini-array" "--with-linker-hash-style=gnu")
files="https://ftpmirror.gnu.org/gnu/gcc/gcc-${version}/gcc-${version}.tar.xz gcc-${version}.tar.xz d08edc536b54c372a1010ff6619dd274c0f1603aa49212ba20f7aa2cda36fa8b"
configopts=("--target=${SERENITY_ARCH}-pc-serenity" "--with-sysroot=/" "--with-build-sysroot=${SERENITY_INSTALL_ROOT}" "--enable-languages=c,c++" "--disable-lto" "--disable-nls" "--enable-shared" "--enable-default-pie" "--enable-host-shared" "--enable-threads=posix" "--enable-initfini-array" "--with-linker-hash-style=gnu")
files="https://ftpmirror.gnu.org/gnu/gcc/gcc-${version}/gcc-${version}.tar.xz gcc-${version}.tar.xz 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b"
makeopts=("all-gcc" "all-target-libgcc" "all-target-libstdc++-v3" "-j$(nproc)")
installopts=("DESTDIR=${SERENITY_INSTALL_ROOT}" "install-gcc" "install-target-libgcc" "install-target-libstdc++-v3")
depends=("binutils" "gmp" "mpfr" "mpc" "isl")
@ -12,10 +12,11 @@ auth_type="sha256"
build() {
run make "${makeopts[@]}"
run find "./host-${SERENITY_ARCH}-pc-serenity/gcc/" -maxdepth 1 -type f -executable -exec strip --strip-debug {} \; || echo
run find "./host-${SERENITY_ARCH}-pc-serenity/gcc/" -maxdepth 1 -type f -executable -exec $STRIP --strip-debug {} \; || echo
}
install() {
run make "${installopts[@]}"
run ln -sf gcc "${SERENITY_INSTALL_ROOT}/usr/local/bin/cc"
run ln -sf g++ "${SERENITY_INSTALL_ROOT}/usr/local/bin/c++"
}

View file

@ -1,20 +0,0 @@
diff -Naur gcc-11.1.0/libstdc++-v3/include/c_compatibility/fenv.h gcc-11.1.0.serenity/libstdc++-v3/include/c_compatibility/fenv.h
--- gcc-11.1.0/libstdc++-v3/include/c_compatibility/fenv.h 2021-04-27 12:00:16.000000000 +0200
+++ gcc-11.1.0.serenity/libstdc++-v3/include/c_compatibility/fenv.h 2021-04-27 18:19:15.749373118 +0200
@@ -26,8 +26,8 @@
* This is a Standard C++ Library header.
*/
-#ifndef _GLIBCXX_FENV_H
-#define _GLIBCXX_FENV_H 1
+#ifndef _GLIBCXX_PORT_FENV_H
+#define _GLIBCXX_PORT_FENV_H 1
#pragma GCC system_header
@@ -78,4 +78,4 @@
#endif // C++11
-#endif // _GLIBCXX_FENV_H
+#endif // _GLIBCXX_PORT_FENV_H

View file

@ -1,129 +0,0 @@
From 37f6a0c24bb07efb29a2222d984e4d793c165aef Mon Sep 17 00:00:00 2001
From: Martin Liska <mliska@suse.cz>
Date: Tue, 21 Dec 2021 17:43:55 +0100
Subject: [PATCH] Support ld.mold linker.
gcc/ChangeLog:
* collect2.c (main): Add ld.mold.
* common.opt: Add -fuse-ld=mold.
* doc/invoke.texi: Document it.
* gcc.c (driver_handle_option): Handle -fuse-ld=mold.
* opts.c (common_handle_option): Likewise.
---
gcc/collect2.c | 10 +++++++---
gcc/common.opt | 4 ++++
gcc/doc/invoke.texi | 4 ++++
gcc/gcc.c | 4 ++++
gcc/opts.c | 1 +
5 files changed, 20 insertions(+), 3 deletions(-)
diff --git a/gcc/collect2.c b/gcc/collect2.c
index 0c8af2987..6bb5cf9a4 100644
--- a/gcc/collect2.c
+++ b/gcc/collect2.c
@@ -785,6 +785,7 @@ main (int argc, char **argv)
USE_GOLD_LD,
USE_BFD_LD,
USE_LLD_LD,
+ USE_MOLD_LD,
USE_LD_MAX
} selected_linker = USE_DEFAULT_LD;
static const char *const ld_suffixes[USE_LD_MAX] =
@@ -793,7 +794,8 @@ main (int argc, char **argv)
PLUGIN_LD_SUFFIX,
"ld.gold",
"ld.bfd",
- "ld.lld"
+ "ld.lld",
+ "ld.mold"
};
static const char *const real_ld_suffix = "real-ld";
static const char *const collect_ld_suffix = "collect-ld";
@@ -970,6 +972,8 @@ main (int argc, char **argv)
selected_linker = USE_GOLD_LD;
else if (strcmp (argv[i], "-fuse-ld=lld") == 0)
selected_linker = USE_LLD_LD;
+ else if (strcmp (argv[i], "-fuse-ld=mold") == 0)
+ selected_linker = USE_MOLD_LD;
else if (strncmp (argv[i], "-o", 2) == 0)
{
/* Parse the output filename if it's given so that we can make
@@ -1082,7 +1086,7 @@ main (int argc, char **argv)
ld_file_name = 0;
#ifdef DEFAULT_LINKER
if (selected_linker == USE_BFD_LD || selected_linker == USE_GOLD_LD ||
- selected_linker == USE_LLD_LD)
+ selected_linker == USE_LLD_LD || selected_linker == USE_MOLD_LD)
{
char *linker_name;
# ifdef HOST_EXECUTABLE_SUFFIX
@@ -1317,7 +1321,7 @@ main (int argc, char **argv)
else if (!use_collect_ld
&& strncmp (arg, "-fuse-ld=", 9) == 0)
{
- /* Do not pass -fuse-ld={bfd|gold|lld} to the linker. */
+ /* Do not pass -fuse-ld={bfd|gold|lld|mold} to the linker. */
ld1--;
ld2--;
}
diff --git a/gcc/common.opt b/gcc/common.opt
index 6fab7c3ca..8617124f9 100644
--- a/gcc/common.opt
+++ b/gcc/common.opt
@@ -2967,6 +2967,10 @@ fuse-ld=lld
Common Driver Negative(fuse-ld=lld)
Use the lld LLVM linker instead of the default linker.
+fuse-ld=mold
+Common Driver Negative(fuse-ld=mold)
+Use the Modern linker (MOLD) linker instead of the default linker.
+
fuse-linker-plugin
Common Undocumented Var(flag_use_linker_plugin)
diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi
index 7f13ffb79..31932cf2c 100644
--- a/gcc/doc/invoke.texi
+++ b/gcc/doc/invoke.texi
@@ -15601,6 +15601,10 @@ Use the @command{gold} linker instead of the default linker.
@opindex fuse-ld=lld
Use the LLVM @command{lld} linker instead of the default linker.
+@item -fuse-ld=mold
+@opindex fuse-ld=mold
+Use the Modern Linker (@command{mold}) instead of the default linker.
+
@cindex Libraries
@item -l@var{library}
@itemx -l @var{library}
diff --git a/gcc/gcc.c b/gcc/gcc.c
index 4d790f9dd..ce6366946 100644
--- a/gcc/gcc.c
+++ b/gcc/gcc.c
@@ -4189,6 +4189,10 @@ driver_handle_option (struct gcc_options *opts,
use_ld = ".gold";
break;
+ case OPT_fuse_ld_mold:
+ use_ld = ".mold";
+ break;
+
case OPT_fcompare_debug_second:
compare_debug_second = 1;
break;
diff --git a/gcc/opts.c b/gcc/opts.c
index 24bb64198..9192ca757 100644
--- a/gcc/opts.c
+++ b/gcc/opts.c
@@ -2875,6 +2875,7 @@ common_handle_option (struct gcc_options *opts,
case OPT_fuse_ld_bfd:
case OPT_fuse_ld_gold:
case OPT_fuse_ld_lld:
+ case OPT_fuse_ld_mold:
case OPT_fuse_linker_plugin:
/* No-op. Used by the driver and passed to us because it starts with f.*/
break;
--
2.34.1

File diff suppressed because it is too large Load diff

1
Ports/gcc/patches/gcc.patch Symbolic link
View file

@ -0,0 +1 @@
../../../Toolchain/Patches/gcc.patch