From patchwork Fri Apr 27 09:18:11 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steven Drake X-Patchwork-Id: 155400 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 3AAA3B6EEC for ; Fri, 27 Apr 2012 19:18:30 +1000 (EST) Comment: DKIM? See http://www.dkim.org DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=gcc.gnu.org; s=default; x=1336123111; h=Comment: DomainKey-Signature:Received:Received:Received:Received:Date: From:To:Subject:Message-ID:User-Agent:MIME-Version:Content-Type: Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:Sender:Delivered-To; bh=e+z6R9VuTuM9KlnJ+Yg5 b8iLEjo=; b=Hh6ztF7N9b4q81SZLKrgp7qOgZ7aWvP6OAlE4Lut1V0SImb4NBfv P2+byEvQK255+MseD9th2PHUtxPRGo4MeNFuoQ0aMlf7ep3JYR3KTlmFPXi671yD TsxxHDS/ik2RMeUwNlnmj4RBtzTgVpYftgnE33aQWabnavjU5HwbdJE= Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=default; d=gcc.gnu.org; h=Received:Received:X-SWARE-Spam-Status:X-Spam-Check-By:Received:Received:Date:From:To:Subject:Message-ID:User-Agent:MIME-Version:Content-Type:Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender:Delivered-To; b=RBkQIUuZ/3+0jzPM6qmp8VjLWKq6Utb7EMAbYmXkqZ0DPsE6qQ2Ww3QqE+ntGN tp/cI8EhUM7F+X/mVoRZ8idp/PawjYctCSFCiMiFL7uekipjbVJedSprUjHNyhLy EChg5DBtcCM0oiKViNHXoaN/ELVyFakTLA6QtdCnMWGug=; Received: (qmail 26198 invoked by alias); 27 Apr 2012 09:18:27 -0000 Received: (qmail 26187 invoked by uid 22791); 27 Apr 2012 09:18:26 -0000 X-SWARE-Spam-Status: No, hits=-4.2 required=5.0 tests=BAYES_00, KHOP_RCVD_UNTRUST, RCVD_IN_DNSWL_LOW, RCVD_IN_HOSTKARMA_W, RCVD_IN_HOSTKARMA_WL, SUBJ_OBFU_PUNCT_FEW X-Spam-Check-By: sourceware.org Received: from atlas.wxnz.net (HELO atlas.wxnz.net) (58.28.6.122) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 27 Apr 2012 09:18:13 +0000 Received: from altar.drake.org.nz (ip-118-90-124-24.xdsl.xnet.co.nz [118.90.124.24]) by atlas.wxnz.net (Postfix) with ESMTP id 7AD022D8D25 for ; Fri, 27 Apr 2012 21:18:11 +1200 (NZST) Date: Fri, 27 Apr 2012 21:18:11 +1200 (NZST) From: Steven Drake To: gcc-patches@gcc.gnu.org Subject: Request new specs string token for multilib_os_dir Message-ID: User-Agent: Alpine 2.00 (LNX 1167 2008-08-23) MIME-Version: 1.0 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 In the GCC FAQ under "Dynamic linker is unable to find GCC libraries", one suggestion is to add '-R' or '-rpath' linker option to the *link or *lib specs so that the GCC libraries can be found. E.G. the following line is added to the DRIVER_DEFINES when building gcc via pkgsrc ('$(LINKER_RPATH_FLAG)' comes from the environment): -DLINK_LIBGCC_SPEC="\"%D $(LINKER_RPATH_FLAG)$(libdir) \"" This is needed as the prefix is normally something like '/usr/pkg/gcc47'. The problem is that this does not allow for multilib os directory's and there is currently no simple way of dong so. My solution is to add the '%M' token that expands to multilib_os_dir. The above line can then be easily change to handle multilib directory's: -DLINK_LIBGCC_SPEC="\"%D $(LINKER_RPATH_FLAG)$(libdir)/%M \"" 2012-04-27 Steven Drake * gcc.c (do_spec_1): Add %M spec token to output multilib_os_dir. --- gcc/gcc.c.orig 2012-02-28 17:31:38.000000000 +0000 +++ gcc/gcc.c @@ -5115,6 +5115,13 @@ do_spec_1 (const char *spec, int inswitc return value; break; + case 'M': + if (multilib_os_dir == NULL) + obstack_1grow (&obstack, '.'); + else + obstack_grow (&obstack, multilib_os_dir, strlen(multilib_os_dir)); + break; + case 'G': value = do_spec_1 (libgcc_spec, 0, NULL); if (value != 0)