From patchwork Wed Aug 18 10:28:45 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jack Howarth X-Patchwork-Id: 62024 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 80DB1B70DF for ; Wed, 18 Aug 2010 20:28:55 +1000 (EST) Received: (qmail 32349 invoked by alias); 18 Aug 2010 10:28:54 -0000 Received: (qmail 32337 invoked by uid 22791); 18 Aug 2010 10:28:54 -0000 X-SWARE-Spam-Status: No, hits=-1.8 required=5.0 tests=AWL, BAYES_00, TW_BJ, TW_LR, 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; Wed, 18 Aug 2010 10:28:49 +0000 Received: from bromo.med.uc.edu (localhost.localdomain [127.0.0.1]) by bromo.med.uc.edu (Postfix) with ESMTP id 7B551B0074; Wed, 18 Aug 2010 06:28:46 -0400 (EDT) Received: (from howarth@localhost) by bromo.med.uc.edu (8.14.3/8.14.3/Submit) id o7IASkrh028920; Wed, 18 Aug 2010 06:28:46 -0400 Date: Wed, 18 Aug 2010 06:28:45 -0400 From: Jack Howarth To: gcc-patches@gcc.gnu.org Cc: mikestump@comcast.net, iains@gcc.gnu.org Subject: [PATCH] extend libSystem symlink pruning Message-ID: <20100818102845.GA28918@bromo.med.uc.edu> MIME-Version: 1.0 Content-Disposition: inline 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 The attached patch extends the symlinks to libSystem that are pruned in config/darwin.h's LINK_SPEC. Remove-outfile is only used to remove -lc when !nodefaultlibs. The remaing instances of -ldbm, -linfo, -lpoll, -lproc and -lrpcsvc are removed unconditionally. Bootstrapped and regression tested on x86_64-apple-darwin10. Okay for gcc trunk? Jack ps I've omitted the remaining libgcc_s.1.dylib symlink on 10.6 and later (which is present due to libgcc being subsumed into libSystem) because it is unclear how this can be done conditionally. 2010-08-17 Jack Howarth * config/darwin.h (LINK_SPEC): Add remove -lc, conditional on !nodefaultlibs, -ldbm, -linfo, -lpoll, -lproc and -lrpcsvc. Index: gcc/config/darwin.h =================================================================== --- gcc/config/darwin.h (revision 163323) +++ gcc/config/darwin.h (working copy) @@ -303,9 +303,15 @@ so put a * after their names so all of them get passed. */ #define LINK_SPEC \ "%{static}%{!static:-dynamic} \ + %{!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) \ %{fgnu-runtime: %{static|static-libgcc: \ %:replace-outfile(-lobjc libobjc-gnu.a%s); \ :%:replace-outfile(-lobjc -lobjc-gnu ) } }\