From patchwork Wed Jul 10 19:35:21 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Iain Sandoe X-Patchwork-Id: 1130551 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gcc.gnu.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-504863-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=sandoe.co.uk Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="qbW4b9zF"; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 45kTtd1fMtz9s4V for ; Thu, 11 Jul 2019 05:35:37 +1000 (AEST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :content-type:content-transfer-encoding:mime-version:subject :message-id:date:cc:to; q=dns; s=default; b=jMY0bQQbJP9w0zqRtLo2 1x1E858jfY882zlR8JqQOt1MhZimHLMJ6ndNyR5PVoCg2NLMDX+gjjX5scYpd33Y MLt0giPnR43f4bvLh0hYh2xDapJyIqUe56wRLhne6dv4YS96XoIPXlmWgX8EhuXA 1mseqJ6MUgR1iRFpSTL3iHY= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :content-type:content-transfer-encoding:mime-version:subject :message-id:date:cc:to; s=default; bh=ogZxomIAbbbO4eR9MOMmwRtatv w=; b=qbW4b9zFGCZuUoGHwKy0COxuSQLzMZ5Mao5BUHbN1E6FsSsivoFiQ7Zhbn YCmt6kxEDjIQWLc63UK92ooSLGgugT7+DLQskAYKGUEGow5GvKqE0ZDB2gzw9A4S D/QQ413QaaP85DeV/lbu0G6AQh7GUHfLCI7EhHyNmL3LE7oZM= Received: (qmail 105058 invoked by alias); 10 Jul 2019 19:35:30 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 105049 invoked by uid 89); 10 Jul 2019 19:35:29 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-22.8 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_COUK, KAM_SHORT, RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 spammy=10.3, 175, HX-Spam-Relays-External:ESMTPA X-HELO: smtp2.wavenetuk.net Received: from smtp.wavenetuk.net (HELO smtp2.wavenetuk.net) (195.26.37.10) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 10 Jul 2019 19:35:27 +0000 Received: from euterpe-sie.home (host81-138-1-83.in-addr.btopenworld.com [81.138.1.83]) by smtp2.wavenetuk.net (Postfix) with ESMTPA id 7921560018E; Wed, 10 Jul 2019 20:35:24 +0100 (BST) From: Iain Sandoe Mime-Version: 1.0 (Mac OS X Mail 10.3 \(3273\)) Subject: [Darwin, PPC, committed] Collate the system library spec into one expression. Message-Id: <91C9BAD3-9391-4AD1-B539-91A111906BAE@sandoe.co.uk> Date: Wed, 10 Jul 2019 20:35:21 +0100 Cc: Segher Boessenkool To: GCC Patches There's no need to redefine this dependent on the target header (that only works in the case that we have self-hosting which is less and less likely for the older system versions). Actually, what we need is for the correct library set to be used based on the SDK(s) that can target the chosen system. This is a collated version that applies the constraints based on the system version being compiled for. tested on powerpc-darwin9, applied to mainline, thanks Iain gcc/ 2019-07-10 Iain Sandoe * config/rs6000/darwin.h (LIB_SPEC): Collate this spec here. * config/rs6000/darwin7.h (LIB_SPEC): Remove. * config/rs6000/darwin8.h (LIB_SPEC): Remove. (DEF_MIN_OSX_VERSION): New. diff --git a/gcc/config/rs6000/darwin.h b/gcc/config/rs6000/darwin.h index b0b5047..272cd45 100644 --- a/gcc/config/rs6000/darwin.h +++ b/gcc/config/rs6000/darwin.h @@ -86,6 +86,24 @@ extern int darwin_emit_picsym_stub; #define RS6000_DEFAULT_LONG_DOUBLE_SIZE 128 +/* Machine dependent libraries. + Include libmx when targeting Darwin 7.0 and above, but before libSystem, + since the functions are actually in libSystem but for 7.x compatibility + we want them to be looked for in libmx first. + Include libSystemStubs when compiling against 10.3 - 10.5 SDKs (we assume + this is the case when targetting these) - but not for 64-bit long double. + Don't do either for m64, the library is either a dummy or non-existent. +*/ + +#undef LIB_SPEC +#define LIB_SPEC \ +"%{!static: \ + %{!m64:%{!mlong-double-64: \ + %{pg:%:version-compare(>< 10.3 10.5 mmacosx-version-min= -lSystemStubs_profile)} \ + %{!pg:%:version-compare(>< 10.3 10.5 mmacosx-version-min= -lSystemStubs)} \ + %:version-compare(>< 10.3 10.4 mmacosx-version-min= -lmx)}} \ + -lSystem \ +}" /* We want -fPIC by default, unless we're using -static to compile for the kernel or some such. The "-faltivec" option should have been diff --git a/gcc/config/rs6000/darwin7.h b/gcc/config/rs6000/darwin7.h index d299074..6a3adc0 100644 --- a/gcc/config/rs6000/darwin7.h +++ b/gcc/config/rs6000/darwin7.h @@ -17,21 +17,11 @@ You should have received a copy of the GNU General Public License along with GCC; see the file COPYING3. If not see . */ -/* Machine dependent libraries. Include libmx when compiling for - Darwin 7.0 and above, but before libSystem, since the functions are - actually in libSystem but for 7.x compatibility we want them to be - looked for in libmx first. Include libmx by default because otherwise - libstdc++ isn't usable. */ - -#undef LIB_SPEC -#define LIB_SPEC "%{!static:\ - %:version-compare(!< 10.3 mmacosx-version-min= -lmx)\ - -lSystem}" - /* This generation of tools (specifically the archive tool) did not export weak symbols from the TOC. */ #undef TARGET_WEAK_NOT_IN_ARCHIVE_TOC #define TARGET_WEAK_NOT_IN_ARCHIVE_TOC 1 +/* Default to the last version, with most support for C++. */ #undef DEF_MIN_OSX_VERSION #define DEF_MIN_OSX_VERSION "10.3.9" diff --git a/gcc/config/rs6000/darwin8.h b/gcc/config/rs6000/darwin8.h index ca4ede2..ec5a8af 100644 --- a/gcc/config/rs6000/darwin8.h +++ b/gcc/config/rs6000/darwin8.h @@ -17,15 +17,5 @@ You should have received a copy of the GNU General Public License along with GCC; see the file COPYING3. If not see . */ -/* Machine dependent libraries. Include libmx when compiling on - Darwin 7.0 and above, but before libSystem, since the functions are - actually in libSystem but for 7.x compatibility we want them to be - looked for in libmx first---but only do this if 7.x compatibility - is a concern, which it's not in 64-bit mode. Include - libSystemStubs when compiling on (not necessarily for) 8.0 and - above and not 64-bit long double. */ - -#undef LIB_SPEC -#define LIB_SPEC "%{!static:\ - %{!mlong-double-64:%{pg:-lSystemStubs_profile;:-lSystemStubs}} \ - %{!m64:%:version-compare(>< 10.3 10.4 mmacosx-version-min= -lmx)} -lSystem}" +#undef DEF_MIN_OSX_VERSION +#define DEF_MIN_OSX_VERSION "10.4"