gcc-11.2.0: Add jessica's pthread fix, drop non-working darwin fix

This commit is contained in:
Alexander von Gluck IV
2022-03-25 17:25:10 -05:00
parent b9f430f22d
commit f61837f6dc
2 changed files with 55 additions and 44 deletions

View File

@@ -5,7 +5,7 @@ HOMEPAGE="https://gcc.gnu.org/"
COPYRIGHT="1988-2021 Free Software Foundation, Inc."
LICENSE="GNU GPL v3
GNU LGPL v3"
REVISION="6"
REVISION="7"
gccVersion="${portVersion%%_*}"
SOURCE_URI="https://ftpmirror.gnu.org/gcc/gcc-$gccVersion/gcc-$gccVersion.tar.xz
https://ftp.gnu.org/gnu/gcc/gcc-$gccVersion/gcc-$gccVersion.tar.xz"

View File

@@ -3566,53 +3566,64 @@ index 63984ecd5..8c02be651 100644
--
2.35.1
From f1292dd59fa71d8e548646b3508146c7f2b80861 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Przemys=C5=82aw=20Buczkowski?= <prem@prem.moe>
Date: Sat, 19 Mar 2022 10:01:48 -0500
Subject: [PATCH 3/3] GCC: Patch for Apple Silicon compatibility
From eb02cc7e55dca3280656315022420fbadbca4005 Mon Sep 17 00:00:00 2001
From: Jessica Hamilton <jessica.l.hamilton@gmail.com>
Date: Fri, 25 Mar 2022 17:20:48 -0500
Subject: [PATCH] haiku: allow passing -pthread as a no-op.
This patch fixes a linker error occuring when compiling
the cross-compiler on macOS and ARM64 architecture.
Adapted from:
https://github.com/richfelker/musl-cross-make/issues/116#issuecomment-823612404
---
gcc/config/aarch64/aarch64.h | 2 +-
gcc/config/host-darwin.c | 4 ++++
2 files changed, 5 insertions(+), 1 deletion(-)
gcc/config.gcc | 1 +
gcc/config/haiku.opt | 29 +++++++++++++++++++++++++++++
2 files changed, 30 insertions(+)
create mode 100644 gcc/config/haiku.opt
diff --git a/gcc/config/aarch64/aarch64.h b/gcc/config/aarch64/aarch64.h
index bfffbcd6a..4301cbffa 100644
--- a/gcc/config/aarch64/aarch64.h
+++ b/gcc/config/aarch64/aarch64.h
@@ -1236,7 +1236,7 @@ extern const char *aarch64_rewrite_mcpu (int argc, const char **argv);
#define MCPU_TO_MARCH_SPEC_FUNCTIONS \
{ "rewrite_mcpu", aarch64_rewrite_mcpu },
-#if defined(__aarch64__)
+#if defined(__aarch64__) && !defined(__APPLE__)
extern const char *host_detect_local_cpu (int argc, const char **argv);
#define HAVE_LOCAL_CPU_DETECT
# define EXTRA_SPEC_FUNCTIONS \
diff --git a/gcc/config/host-darwin.c b/gcc/config/host-darwin.c
index 14a01fe71..e87b86676 100644
--- a/gcc/config/host-darwin.c
+++ b/gcc/config/host-darwin.c
@@ -22,6 +22,8 @@
#include "coretypes.h"
#include "diagnostic-core.h"
#include "config/host-darwin.h"
+#include "hosthooks.h"
+#include "hosthook-def.h"
/* Yes, this is really supposed to work. */
/* This allows for a pagesize of 16384, which we have on Darwin20, but should
@@ -79,3 +81,5 @@ darwin_gt_pch_use_address (void *addr, size_t sz, int fd, size_t off)
return ret;
}
diff --git a/gcc/config.gcc b/gcc/config.gcc
index 98128be40..b5d16afa2 100644
--- a/gcc/config.gcc
+++ b/gcc/config.gcc
@@ -839,6 +839,7 @@ case ${target} in
default_use_cxa_atexit=yes
tm_p_file="${tm_p_file} haiku-protos.h"
extra_objs="${extra_objs} haiku.o"
+ extra_options="${extra_options} haiku.opt"
;;
*-*-linux* | frv-*-*linux* | *-*-kfreebsd*-gnu | *-*-gnu* | *-*-kopensolaris*-gnu | *-*-uclinuxfdpiceabi)
extra_options="$extra_options gnu-user.opt"
diff --git a/gcc/config/haiku.opt b/gcc/config/haiku.opt
new file mode 100644
index 000000000..efa187289
--- /dev/null
+++ b/gcc/config/haiku.opt
@@ -0,0 +1,29 @@
+; Haiku options.
+
+const struct host_hooks host_hooks = HOST_HOOKS_INITIALIZER;
+; Copyright (C) 2010-2022 Free Software Foundation, Inc.
+;
+; This file is part of GCC.
+;
+; GCC is free software; you can redistribute it and/or modify it under
+; the terms of the GNU General Public License as published by the Free
+; Software Foundation; either version 3, or (at your option) any later
+; version.
+;
+; GCC is distributed in the hope that it will be useful, but WITHOUT ANY
+; WARRANTY; without even the implied warranty of MERCHANTABILITY or
+; FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+; for more details.
+;
+; You should have received a copy of the GNU General Public License
+; along with GCC; see the file COPYING3. If not see
+; <http://www.gnu.org/licenses/>.
+
+; See the GCC internals manual (options.texi) for a description of
+; this file's format.
+
+; Please try to keep this file in ASCII collating order.
+
+pthread
+Driver
+
+; This comment is to ensure we retain the blank line above.
--
2.35.1