From patchwork Sun Aug 22 15:17:24 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jack Howarth X-Patchwork-Id: 62389 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) by ozlabs.org (Postfix) with SMTP id 3C181B6F0E for ; Mon, 23 Aug 2010 01:17:46 +1000 (EST) Received: (qmail 22450 invoked by alias); 22 Aug 2010 15:17:43 -0000 Received: (qmail 22437 invoked by uid 22791); 22 Aug 2010 15:17:42 -0000 X-SWARE-Spam-Status: No, hits=-1.9 required=5.0 tests=AWL, BAYES_00, TW_BJ, T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from bromo.med.uc.edu (HELO bromo.med.uc.edu) (129.137.3.146) by sourceware.org (qpsmtpd/0.43rc1) with SMTP; Sun, 22 Aug 2010 15:17:27 +0000 Received: from bromo.med.uc.edu (localhost.localdomain [127.0.0.1]) by bromo.med.uc.edu (Postfix) with ESMTP id C0B53B005D; Sun, 22 Aug 2010 11:17:24 -0400 (EDT) Received: (from howarth@localhost) by bromo.med.uc.edu (8.14.3/8.14.3/Submit) id o7MFHORo015833; Sun, 22 Aug 2010 11:17:24 -0400 Date: Sun, 22 Aug 2010 11:17:24 -0400 From: Jack Howarth To: Mike Stump Cc: gcc-patches@gcc.gnu.org, iains@gcc.gnu.org Subject: Re: [PATCH] Depreciate darwin[0-7] Message-ID: <20100822151724.GA15778@bromo.med.uc.edu> References: <20100821035307.GA16646@bromo.med.uc.edu> <20100822000546.GA22227@bromo.med.uc.edu> <77F2F9CD-575C-480A-99E0-44EEE9D644C8@comcast.net> <20100822025058.GA22960@bromo.med.uc.edu> <8BA09B63-996C-49E7-B3A0-18EC1060780E@comcast.net> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <8BA09B63-996C-49E7-B3A0-18EC1060780E@comcast.net> User-Agent: Mutt/1.5.18 (2008-05-17) 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 On Sat, Aug 21, 2010 at 08:40:55PM -0700, Mike Stump wrote: > On Aug 21, 2010, at 7:50 PM, Jack Howarth wrote: > > On Sat, Aug 21, 2010 at 07:21:27PM -0700, Mike Stump wrote: > >> On Aug 21, 2010, at 5:05 PM, Jack Howarth wrote: > >>> How exactly do you propose we make the use of remove-outfile conditional? > >> > >> The standard way: > >> > >> :%:version-compare(>< 10.3.9 10.5 mmacosx-version-min= -lgcc_s.10.4) > >> > >> For example means 10.4.x.... > >> > >> If you want just 10.5 or later: > >> > >> %:version-compare(>= 10.5 mmacosx-version-min= -lgcc_s.10.5) > >> > >> is a typical line that will do this. For -lm, the dynamic check is better than the static check, as then SDKs work just fine. > >> > >>> Also, the existing version-compare() is insufficient because it only > >>> allows assignments and not the nested calling of another spec function. > >> > >> Ah, but we can unconditionally remove -lm, that's not such a big deal. We just _must_ add it back to the link line, at the proper spot, if we're dealing with deployment before x. It was the unconditional removal of -lm from the link line that was bad. Of course, better would be to extend out support in version compare so that is it logically composable, so that one can just wrap the entire thing inside a version compare. > > > > Isn't libm effectively added with -lmx by... > > Oh, I was just using it as an example, I glanced at the entire list of removed libraries, and realized that we could hack in -lm (-lmx), if it were just that one library, given all the others, it would be better to not remove them. > > > This just leaves darwin6 which seems absurdly old to try to support. > > Why? In general, as work goes in that can't work on darwin(n-1), it also can't work on darwin6. You get support for darwin6 for free. It isn't unreasonable to keep n-1 working, and once you do that, then support for all past systems is usually trivial. This is by design. > > > time frame when Xcode releases were insufficient and a separate odcctools package was required. > > Those people still building on those systems already have that package, or can download it as pointed out the in the documentation. That hasn't changes in years. > > > I haven't heard of any users building gcc on darwin6 for quite some time. > > Me either, and I've not thought about it in quite some time either. > > So, for example, the outfile stuff, if it is only appropriate for darwin6 or later, it can go into darwin.h, if only appropriate for darwin7, darwin7.h, darwin8 or later, darwin8.h, darwin9 or later, darwin9.h, darwin10 or later, darwin10.h.... Now, if the work went into darwin.h instead of darwin10.h, that is a logical two line fix. Mike, On reflection, it appears that no solution will be viable except for the proper one of adding a version-compare-specfunc spec function which can call other spec functions within itself. I considered other alternatives like... but this is only a partial solution. The decision on using remove-outfile needs to be applied at run time based on the SDK in use. I suspect we should be okay with the limited (-ldl, -lm and -lpthread) pruning as long as the obsolete darwins are passed -lmx. That set of remove-outfile calls is sufficient to resolve the linkage order issues within FSF gcc build itself. Jack Index: config/darwin.h =================================================================== --- config/darwin.h (revision 163460) +++ config/darwin.h (working copy) @@ -301,11 +301,8 @@ 'Z' and 'no' prefixes). Note that options taking arguments may appear multiple times on a command line with different arguments each time, so put a * after their names so all of them get passed. */ -#define LINK_SPEC \ +#define CORE_LINK_SPEC \ "%{static}%{!static:-dynamic} \ - %:remove-outfile(-ldl) \ - %:remove-outfile(-lm) \ - %:remove-outfile(-lpthread) \ %{fgnu-runtime: %{static|static-libgcc: \ %:replace-outfile(-lobjc libobjc-gnu.a%s); \ :%:replace-outfile(-lobjc -lobjc-gnu ) } }\ @@ -386,6 +383,7 @@ %{whatsloaded} %{dylinker_install_name*} \ %{dylinker} %{Mach} " +#define LINK_SPEC "CORE_LINK_SPEC" /* Machine dependent libraries. */ Index: config/darwin9.h =================================================================== --- config/darwin9.h (revision 163460) +++ config/darwin9.h (working copy) @@ -33,6 +33,20 @@ /* libSystem contains unwind information for signal frames. */ #define DARWIN_LIBSYSTEM_HAS_UNWIND +#undef LINK_SPEC +#define LINK_SPEC \ + "%{!nodefaultlibs: %:remove-outfile(-lc) } \ + %:remove-outfile(-ldbm) \ + %:remove-outfile(-ldl) \ + %:remove-outfile(-linfo) \ + %:remove-outfile(-lm) \ + %:remove-outfile(-lpoll) \ + %:remove-outfile(-lproc) \ + %:remove-outfile(-lpthread) \ + %:remove-outfile(-lrpcsvc) \ + CORE_LINK_SPEC" + + #undef ASM_OUTPUT_ALIGNED_COMMON #define ASM_OUTPUT_ALIGNED_COMMON(FILE, NAME, SIZE, ALIGN) \ do { \