From: Iain Sandoe <iain@sandoe.co.uk>
To: GCC Patches <gcc-patches@gcc.gnu.org>
Subject: [pushed] Darwin, config : Adjust X86 biarch definitions ordering [PR100269].
Date: Sun, 4 Jul 2021 20:41:19 +0100 [thread overview]
Message-ID: <21407674-0005-43D7-A6AC-290101CE0BFB@sandoe.co.uk> (raw)
Hi
This reorganises the biarch definitions to cater for the
macro changes and removals at r12-36.
tested across the Darwin range,
pushed to master, thanks
Iain
Signed-off-by: Iain Sandoe <iain@sandoe.co.uk>
PR target/100269 - [12 Regression] i686 biarch compiler fails for Darwin after r12-36.
PR target/100269
gcc/ChangeLog:
PR target/100269
* config.gcc: Ensure that Darwin biarch definitions are
added before i386.h.
* config/i386/darwin.h (TARGET_64BIT): Remove.
(PR80556_WORKAROUND): New.
(REAL_LIBGCC_SPEC): Amend to use PR80556_WORKAROUND.
(DARWIN_SUBARCH_SPEC): New.
* config/i386/darwin32-biarch.h (TARGET_64BIT_DEFAULT,
TARGET_BI_ARCH, PR80556_WORKAROUND): New.
(REAL_LIBGCC_SPEC): Remove.
* config/i386/darwin64-biarch.h (TARGET_64BIT_DEFAULT,
TARGET_BI_ARCH, PR80556_WORKAROUND): New.
(REAL_LIBGCC_SPEC): Remove.
---
gcc/config.gcc | 10 +++++++---
gcc/config/i386/darwin.h | 22 ++++++++++------------
gcc/config/i386/darwin32-biarch.h | 22 ++++++----------------
gcc/config/i386/darwin64-biarch.h | 22 ++++++----------------
4 files changed, 29 insertions(+), 47 deletions(-)
diff --git a/gcc/config.gcc b/gcc/config.gcc
index 0230bb88861..f3e94f7c0d8 100644
--- a/gcc/config.gcc
+++ b/gcc/config.gcc
@@ -591,6 +591,8 @@ i[34567]86-*-*)
exit 1
fi
;;
+x86_64-*-darwin*)
+ ;;
x86_64-*-*)
case ${with_abi} in
"")
@@ -1837,7 +1839,7 @@ hppa[12]*-*-hpux11*)
dwarf2=no
fi
;;
-i[34567]86-*-darwin1[89]*)
+i[34567]86-*-darwin1[89]* | i[34567]86-*-darwin2[0-9]*)
echo "Error: 32bit target is not supported after Darwin17" 1>&2
;;
i[34567]86-*-darwin*)
@@ -1845,17 +1847,19 @@ i[34567]86-*-darwin*)
# Baseline choice for a machine that allows m64 support.
with_cpu=${with_cpu:-core2}
tmake_file="${tmake_file} ${cpu_type}/t-darwin32-biarch t-slibgcc"
- tm_file="${tm_file} ${cpu_type}/darwin32-biarch.h"
+ tm_file="${cpu_type}/darwin32-biarch.h ${tm_file} "
;;
x86_64-*-darwin1[89]* | x86_64-*-darwin2[01]*)
# Only 64b from now
+ tm_defines="${tm_defines} TARGET_64BIT_DEFAULT=(OPTION_MASK_ISA_64BIT|OPTION_MASK_ABI_64)"
+ tm_defines="${tm_defines} TARGET_BI_ARCH=0"
with_cpu=${with_cpu:-core2}
tmake_file="${tmake_file} t-slibgcc"
;;
x86_64-*-darwin*)
with_cpu=${with_cpu:-core2}
tmake_file="${tmake_file} ${cpu_type}/t-darwin64-biarch t-slibgcc"
- tm_file="${tm_file} ${cpu_type}/darwin64-biarch.h"
+ tm_file="${cpu_type}/darwin64-biarch.h ${tm_file} "
;;
i[34567]86-*-elfiamcu)
tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h newlib-stdint.h i386/iamcu.h"
diff --git a/gcc/config/i386/darwin.h b/gcc/config/i386/darwin.h
index 5312003a321..bac32197e83 100644
--- a/gcc/config/i386/darwin.h
+++ b/gcc/config/i386/darwin.h
@@ -25,15 +25,6 @@ along with GCC; see the file COPYING3. If not see
#undef DARWIN_X86
#define DARWIN_X86 1
-#ifdef IN_LIBGCC2
-#undef TARGET_64BIT
-#ifdef __x86_64__
-#define TARGET_64BIT 1
-#else
-#define TARGET_64BIT 0
-#endif
-#endif
-
/* WORKAROUND pr80556:
For x86_64 Darwin10 and later, the unwinder is in libunwind (redirected
from libSystem). This doesn't use the keymgr (see keymgr.c) and therefore
@@ -44,11 +35,15 @@ along with GCC; see the file COPYING3. If not see
even when static-libgcc is specified. We put libSystem first so that
unwinder symbols are satisfied from there.
We default to 64b for single-arch builds, so apply this unconditionally. */
+#ifndef PR80556_WORKAROUND
+#define PR80556_WORKAROUND \
+" %:version-compare(>= 10.6 mmacosx-version-min= -lSystem) "
+#endif
#undef REAL_LIBGCC_SPEC
#define REAL_LIBGCC_SPEC \
- "%{static-libgcc|static: \
- %:version-compare(>= 10.6 mmacosx-version-min= -lSystem) \
- -lgcc_eh -lgcc; \
+ "%{static-libgcc|static: " \
+ PR80556_WORKAROUND \
+ " -lgcc_eh -lgcc; \
shared-libgcc|fexceptions|fgnu-runtime: \
%:version-compare(!> 10.5 mmacosx-version-min= -lgcc_s.10.4) \
%:version-compare(>< 10.5 10.6 mmacosx-version-min= -lgcc_s.10.5) \
@@ -142,8 +137,11 @@ along with GCC; see the file COPYING3. If not see
%{mpc64:crtprec64.o%s} \
%{mpc80:crtprec80.o%s}" TM_DESTRUCTOR
+#ifndef DARWIN_ARCH_SPEC
/* We default to x86_64 for single-arch builds, bi-arch overrides. */
#define DARWIN_ARCH_SPEC "x86_64"
+#define DARWIN_SUBARCH_SPEC DARWIN_ARCH_SPEC
+#endif
#undef SUBTARGET_EXTRA_SPECS
#define SUBTARGET_EXTRA_SPECS \
diff --git a/gcc/config/i386/darwin32-biarch.h b/gcc/config/i386/darwin32-biarch.h
index 73b83eb650c..5470edf3f8d 100644
--- a/gcc/config/i386/darwin32-biarch.h
+++ b/gcc/config/i386/darwin32-biarch.h
@@ -21,6 +21,9 @@ along with GCC; see the file COPYING3. If not see
#undef DARWIN_ARCH_SPEC
#define DARWIN_ARCH_SPEC "%{m64:x86_64;:i386}"
+#define TARGET_64BIT_DEFAULT 0
+#define TARGET_BI_ARCH 1
+
/* WORKAROUND pr80556:
For x86_64 Darwin10 and later, the unwinder is in libunwind (redirected
from libSystem). This doesn't use the keymgr (see keymgr.c) and therefore
@@ -30,22 +33,9 @@ along with GCC; see the file COPYING3. If not see
Therefore, for 64b exes at least, we must use the libunwind implementation,
even when static-libgcc is specified. We put libSystem first so that
unwinder symbols are satisfied from there. */
-#undef REAL_LIBGCC_SPEC
-#define REAL_LIBGCC_SPEC \
- "%{static-libgcc|static: \
- %{m64:%:version-compare(>= 10.6 mmacosx-version-min= -lSystem)} \
- -lgcc_eh -lgcc; \
- shared-libgcc|fexceptions|fgnu-runtime: \
- %:version-compare(!> 10.5 mmacosx-version-min= -lgcc_s.10.4) \
- %:version-compare(>< 10.5 10.6 mmacosx-version-min= -lgcc_s.10.5) \
- %:version-compare(!> 10.5 mmacosx-version-min= -lgcc_ext.10.4) \
- %:version-compare(>= 10.5 mmacosx-version-min= -lgcc_ext.10.5) \
- -lgcc ; \
- :%:version-compare(>< 10.3.9 10.5 mmacosx-version-min= -lgcc_s.10.4) \
- %:version-compare(>< 10.5 10.6 mmacosx-version-min= -lgcc_s.10.5) \
- %:version-compare(!> 10.5 mmacosx-version-min= -lgcc_ext.10.4) \
- %:version-compare(>= 10.5 mmacosx-version-min= -lgcc_ext.10.5) \
- -lgcc }"
+#undef PR80556_WORKAROUND
+#define PR80556_WORKAROUND \
+" %{m64:%:version-compare(>= 10.6 mmacosx-version-min= -lSystem)} "
#undef DARWIN_SUBARCH_SPEC
#define DARWIN_SUBARCH_SPEC DARWIN_ARCH_SPEC
diff --git a/gcc/config/i386/darwin64-biarch.h b/gcc/config/i386/darwin64-biarch.h
index 1ae76b8fb91..f5bc3d66750 100644
--- a/gcc/config/i386/darwin64-biarch.h
+++ b/gcc/config/i386/darwin64-biarch.h
@@ -22,6 +22,9 @@ along with GCC; see the file COPYING3. If not see
#undef DARWIN_ARCH_SPEC
#define DARWIN_ARCH_SPEC "%{m32:i386;:x86_64}"
+#define TARGET_64BIT_DEFAULT (OPTION_MASK_ISA_64BIT | OPTION_MASK_ABI_64)
+#define TARGET_BI_ARCH 1
+
/* WORKAROUND pr80556:
For x86_64 Darwin10 and later, the unwinder is in libunwind (redirected
from libSystem). This doesn't use the keymgr (see keymgr.c) and therefore
@@ -31,22 +34,9 @@ along with GCC; see the file COPYING3. If not see
Therefore, for 64b exes at least, we must use the libunwind implementation,
even when static-libgcc is specified. We put libSystem first so that
unwinder symbols are satisfied from there. */
-#undef REAL_LIBGCC_SPEC
-#define REAL_LIBGCC_SPEC \
- "%{static-libgcc|static: \
- %{!m32:%:version-compare(>= 10.6 mmacosx-version-min= -lSystem)} \
- -lgcc_eh -lgcc; \
- shared-libgcc|fexceptions|fgnu-runtime: \
- %:version-compare(!> 10.5 mmacosx-version-min= -lgcc_s.10.4) \
- %:version-compare(>< 10.5 10.6 mmacosx-version-min= -lgcc_s.10.5) \
- %:version-compare(!> 10.5 mmacosx-version-min= -lgcc_ext.10.4) \
- %:version-compare(>= 10.5 mmacosx-version-min= -lgcc_ext.10.5) \
- -lgcc ; \
- :%:version-compare(>< 10.3.9 10.5 mmacosx-version-min= -lgcc_s.10.4) \
- %:version-compare(>< 10.5 10.6 mmacosx-version-min= -lgcc_s.10.5) \
- %:version-compare(!> 10.5 mmacosx-version-min= -lgcc_ext.10.4) \
- %:version-compare(>= 10.5 mmacosx-version-min= -lgcc_ext.10.5) \
- -lgcc }"
+#undef PR80556_WORKAROUND
+#define PR80556_WORKAROUND \
+" %{!m32:%:version-compare(>= 10.6 mmacosx-version-min= -lSystem)} "
#undef DARWIN_SUBARCH_SPEC
#define DARWIN_SUBARCH_SPEC DARWIN_ARCH_SPEC
--
2.24.1
reply other threads:[~2021-07-04 19:41 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=21407674-0005-43D7-A6AC-290101CE0BFB@sandoe.co.uk \
--to=iain@sandoe.co.uk \
--cc=gcc-patches@gcc.gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).