From 4a04f09dc7616ebe76ee71aa50eee54f1115f1f2 Mon Sep 17 00:00:00 2001 From: Iain Sandoe Date: Thu, 31 Dec 2020 14:43:00 +0000 Subject: [PATCH] Darwin, Simplify headers 4/5 : Remove redundant headers. The darwinN.h headers (with the sole exception of darwin7.h, which contains a target macro definition) now only contain values that set fall-backs for cross-compilations, these can be provided from the config.gcc script which means we no longer need the darwinN.h - so delete them. gcc/ChangeLog: * config.gcc: Compute default version information from the configured target. Likewise defaults for ld64. * config/darwin10.h: Removed. * config/darwin12.h: Removed. * config/darwin9.h: Removed. * config/rs6000/darwin8.h: Removed. --- gcc/config.gcc | 48 ++++++++++++++++++++++++++++++------- gcc/config/darwin10.h | 27 --------------------- gcc/config/darwin12.h | 27 --------------------- gcc/config/darwin9.h | 22 ----------------- gcc/config/rs6000/darwin8.h | 21 ---------------- 5 files changed, 39 insertions(+), 106 deletions(-) delete mode 100644 gcc/config/darwin10.h delete mode 100644 gcc/config/darwin12.h delete mode 100644 gcc/config/darwin9.h delete mode 100644 gcc/config/rs6000/darwin8.h diff --git a/gcc/config.gcc b/gcc/config.gcc index 70ecc51c1cf..b942e9700d6 100644 --- a/gcc/config.gcc +++ b/gcc/config.gcc @@ -685,17 +685,47 @@ case ${target} in *-*-darwin*) tmake_file="t-darwin " tm_file="${tm_file} darwin.h" + darwin_os=`echo ${target} | sed 's/.*darwin\([0-9.]*\).*$/\1/'` + darwin_maj=`expr "$darwin_os" : '\([0-9]*\).*'` + macos_min=`expr "$darwin_os" : '[0-9]*\.\([0-9]*\).*'` + macos_maj=10 + if test x"${macos_min}" = x; then + macos_min=0 + fi + def_ld64=85.2 case ${target} in - *-*-darwin9*) - tm_file="${tm_file} darwin9.h" - ;; - *-*-darwin[1][01]*) - tm_file="${tm_file} darwin9.h darwin10.h" - ;; - *-*-darwin[1][2-9]* | *-*-darwin[2][0-9]*) - tm_file="${tm_file} darwin9.h darwin10.h darwin12.h" - ;; + # Darwin 4 to 19 correspond to macOS 10.0 to 10.15 + *-*-darwin[4-9]* | *-*-darwin1[0-9]*) + macos_min=`expr $darwin_maj - 4` + ;; + *-*-darwin20*) + # Darwin 20 corresponds to macOS 11. + macos_maj=11 + def_ld64=609.0 + ;; + *-*-darwin) + case ${cpu_type} in + aarch64) macos_maj=11 ;; + x86_64) macos_min=6 ;; + *) macos_min=5 ;; + esac + case ${host} in + *-*-darwin*) tm_defines="$tm_defines DARWIN_USE_KERNEL_VERS" ;; + *) + # If configuring a cross-compiler then we will have set some + # default above, but it is probably not what was intended. + echo "Warning: Using ${target} is only suitable for Darwin hosts" 1>&2 + echo "configure with an explicit target version" 1>&2 + ;; + esac + ;; + *) + echo "Error: configuring for an unreleased macOS version ${target}" 1>&2 + exit 1 + ;; esac + tm_defines="$tm_defines DEF_MIN_OSX_VERSION=\\\"${macos_maj}.${macos_min}\\\"" + tm_defines="$tm_defines DEF_LD64=\\\"${def_ld64}\\\"" tm_file="${tm_file} ${cpu_type}/darwin.h" tm_p_file="${tm_p_file} darwin-protos.h" target_gtfiles="$target_gtfiles \$(srcdir)/config/darwin.c" diff --git a/gcc/config/darwin10.h b/gcc/config/darwin10.h deleted file mode 100644 index 88b1fd061bb..00000000000 --- a/gcc/config/darwin10.h +++ /dev/null @@ -1,27 +0,0 @@ -/* Target definitions for Darwin (Mac OS X) systems. - Copyright (C) 2009-2020 Free Software Foundation, Inc. - Contributed by Jack Howarth . - -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 -. */ - -#undef DEF_MIN_OSX_VERSION -#define DEF_MIN_OSX_VERSION "10.6" - -#ifndef LD64_VERSION -#undef DEF_LD64 -#define DEF_LD64 "97.7" -#endif diff --git a/gcc/config/darwin12.h b/gcc/config/darwin12.h deleted file mode 100644 index b397703dc78..00000000000 --- a/gcc/config/darwin12.h +++ /dev/null @@ -1,27 +0,0 @@ -/* Target definitions for Darwin (Mac OS X) systems. - Copyright (C) 2009-2020 Free Software Foundation, Inc. - Contributed by Jack Howarth . - -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 -. */ - -#undef DEF_MIN_OSX_VERSION -#define DEF_MIN_OSX_VERSION "10.8" - -#ifndef LD64_VERSION -#undef DEF_LD64 -#define DEF_LD64 "236.4" -#endif diff --git a/gcc/config/darwin9.h b/gcc/config/darwin9.h deleted file mode 100644 index 92a77eeec71..00000000000 --- a/gcc/config/darwin9.h +++ /dev/null @@ -1,22 +0,0 @@ -/* Target definitions for Darwin (Mac OS X) systems. - Copyright (C) 2006-2020 Free Software Foundation, Inc. - Contributed by Apple 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 -. */ - -#undef DEF_MIN_OSX_VERSION -#define DEF_MIN_OSX_VERSION "10.5" diff --git a/gcc/config/rs6000/darwin8.h b/gcc/config/rs6000/darwin8.h deleted file mode 100644 index 01b2dc84291..00000000000 --- a/gcc/config/rs6000/darwin8.h +++ /dev/null @@ -1,21 +0,0 @@ -/* Target definitions for Darwin 8.0 and above (Mac OS X) systems. - Copyright (C) 2004-2020 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 -. */ - -#undef DEF_MIN_OSX_VERSION -#define DEF_MIN_OSX_VERSION "10.4" -- 2.30.2