From patchwork Sat Jan 2 20:17:42 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Iain Sandoe X-Patchwork-Id: 1421784 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=8.43.85.97; helo=sourceware.org; envelope-from=gcc-patches-bounces@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=sandoe.co.uk Received: from sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4D7YBR0Vqgz9sVR for ; Sun, 3 Jan 2021 07:18:55 +1100 (AEDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 151BD386F473; Sat, 2 Jan 2021 20:18:52 +0000 (GMT) X-Original-To: GCC-patches@gcc.gnu.org Delivered-To: GCC-patches@gcc.gnu.org Received: from smtp1.wavenetuk.net (smtp.wavenetuk.net [195.26.36.10]) by sourceware.org (Postfix) with ESMTP id 9CBE23850408 for ; Sat, 2 Jan 2021 20:18:48 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 9CBE23850408 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=sandoe.co.uk Authentication-Results: sourceware.org; spf=none smtp.mailfrom=iain@sandoe.co.uk Received: from [192.168.1.212] (host81-138-1-83.in-addr.btopenworld.com [81.138.1.83]) by smtp1.wavenetuk.net (Postfix) with ESMTPA id 0679B1200A42; Sat, 2 Jan 2021 20:18:48 +0000 (GMT) Mime-Version: 1.0 (Mac OS X Mail 10.3 \(3273\)) Subject: [pushed] Darwin, Simplify headers 4/5 : Remove redundant headers. From: Iain Sandoe In-Reply-To: <9D56D4BF-8647-4239-8AFC-FAFB2E9ADA96@sandoe.co.uk> Date: Sat, 2 Jan 2021 20:17:42 +0000 Message-Id: <9CE4FCC2-DE6C-46F8-8FD3-BB63DBA93CFF@sandoe.co.uk> References: <263D52BC-1BE4-45BB-A62E-1C05EEBBC4B1@sandoe.co.uk> <19B01859-6FBF-4FC6-9CC0-A370199192D3@sandoe.co.uk> <27C7B773-A880-4D7A-AF44-167A700AE3A5@sandoe.co.uk> <9D56D4BF-8647-4239-8AFC-FAFB2E9ADA96@sandoe.co.uk> To: GCC Patches X-Mailer: Apple Mail (2.3273) X-Spam-Status: No, score=-15.2 required=5.0 tests=BAYES_00, GIT_PATCH_0, KAM_COUK, KAM_DMARC_STATUS, KAM_LAZY_DOMAIN_SECURITY, KAM_SHORT, KHOP_HELO_FCRDNS, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces@gcc.gnu.org Sender: "Gcc-patches" Hi 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. tested as per part0, pushed to master Iain 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"