From patchwork Thu Mar 7 11:15:36 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jakub Jelinek X-Patchwork-Id: 225816 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 C7B7F2C0384 for ; Thu, 7 Mar 2013 22:16:02 +1100 (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=1363259764; h=Comment: DomainKey-Signature:Received:Received:Received:Received:Received: Received:Received:Date:From:To:Cc:Subject:Message-ID:Reply-To: MIME-Version:Content-Type:Content-Disposition:User-Agent: Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:Sender:Delivered-To; bh=kryaIM2I0G3a/NxSoC8N yRyrgVM=; b=lnCDNbmT2wjae8oQE9AnhKgu5cRxRWepP69/LaGaZQpEGZcUVy8h gAdvS2HddYVw7IDnykGsQ0Btj0nYBRAZVEo67opPFFDg96WIqDNGtKRO2CIkU+sz Wo5i+4oX8D3O04HtLSH/YqaCUedo0tYGVMZuA7kTGA3XCnrsoqG8Ds8= 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:Received:Received:Received:Date:From:To:Cc:Subject:Message-ID:Reply-To:MIME-Version:Content-Type:Content-Disposition:User-Agent:X-IsSubscribed:Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender:Delivered-To; b=JzZ7nuU/+GN9PTggdtuopeZHYhwI7G23TkTl9tYyVjCTbMpjLViaTNBNeC9Jiy TPpJd4uUNuELVR6z8b7d2AGiaZoVDNAxrLvLtgIATI3xgwmOA5nNOpPFp535dvNH rm6MLnfFQlMHsPVxGSejYUXf+3Rfm+ztdySYo710Z0gIM=; Received: (qmail 19032 invoked by alias); 7 Mar 2013 11:15:56 -0000 Received: (qmail 19015 invoked by uid 22791); 7 Mar 2013 11:15:54 -0000 X-SWARE-Spam-Status: No, hits=-6.6 required=5.0 tests=AWL, BAYES_00, KHOP_RCVD_UNTRUST, KHOP_SPAMHAUS_DROP, RCVD_IN_DNSWL_HI, RCVD_IN_HOSTKARMA_W, RP_MATCHES_RCVD, SPF_HELO_PASS X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 07 Mar 2013 11:15:45 +0000 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r27BFfP8028133 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 7 Mar 2013 06:15:41 -0500 Received: from zalov.cz (vpn1-6-140.ams2.redhat.com [10.36.6.140]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id r27BFcwd001986 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 7 Mar 2013 06:15:40 -0500 Received: from zalov.cz (localhost [127.0.0.1]) by zalov.cz (8.14.5/8.14.5) with ESMTP id r27BFbcP016605; Thu, 7 Mar 2013 12:15:38 +0100 Received: (from jakub@localhost) by zalov.cz (8.14.5/8.14.5/Submit) id r27BFb45016604; Thu, 7 Mar 2013 12:15:37 +0100 Date: Thu, 7 Mar 2013 12:15:36 +0100 From: Jakub Jelinek To: Marcus Shawcroft , Paolo Bonzini , Alexandre Oliva , Matthias Klose Cc: gcc-patches@gcc.gnu.org Subject: [PATCH] Fix -print-multi-os-directory for aarch64 Message-ID: <20130307111536.GA12913@tucnak.redhat.com> Reply-To: Jakub Jelinek MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) X-IsSubscribed: yes 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 Hi! AFAIK aarch64 libraries are supposed to go into /usr/lib64 etc. directories similarly to x86-64 etc., but as aarch64 isn't a true multilib target (having two different backends for 32-bit vs. 64-bit code), currently gcc -print-multi-os-directory prints . instead of ../lib64. The following patch fixes that. As for --disable-multilib purposes gcc.c does: /* When --disable-multilib was used but target defines MULTILIB_OSDIRNAMES, entries starting with .: (and not starting with .:: for multiarch configurations) are there just to find multilib_os_dir, so skip them from output. */ if (this_path[0] == '.' && this_path[1] == ':' && this_path[2] != ':') skip = 1; we need to actually emit static const char *const multilib_raw[] = { ". ;", ".:../lib64 ;", NULL }; for --disable-multiarch resp. static const char *const multilib_raw[] = { ". ;", ".:../lib64:aarch64-linux-gnu ;", NULL }; for --enable-multiarch. Tested (with cross compiler) configured with --target aarch64-linux --enable-languages=c {,--disable-multilib} {,--enable-multarch} (all 4 combinations) and output of all ./xgcc -B ./ --print-{multiarch,multi-lib,multi-directory,multi-os-directory} looks good to me with it (i.e. as before the patch, except --print-multi-so-directory prints ../lib64 instead of . previously. Ok for trunk? 2013-03-07 Jakub Jelinek * config/aarch64/t-aarch64-linux (MULTARCH_DIRNAME): Remove. (MULTILIB_OSDIRNAMES): Set. * genmultilib: If defaultosdirname doesn't start with :: , set defaultosdirname2 instead, clear it and emit two . multilib_raw entries instead of just one. Jakub --- gcc/config/aarch64/t-aarch64-linux.jj 2013-01-11 09:03:10.000000000 +0100 +++ gcc/config/aarch64/t-aarch64-linux 2013-03-07 11:23:07.602568188 +0100 @@ -22,4 +22,4 @@ LIB1ASMSRC = aarch64/lib1funcs.asm LIB1ASMFUNCS = _aarch64_sync_cache_range AARCH_BE = $(if $(findstring TARGET_BIG_ENDIAN_DEFAULT=1, $(tm_defines)),_be) -MULTIARCH_DIRNAME = $(call if_multiarch,aarch64$(AARCH_BE)-linux-gnu) +MULTILIB_OSDIRNAMES = .=../lib64$(call if_multiarch,:aarch64$(AARCH_BE)-linux-gnu) --- gcc/genmultilib.jj 2013-01-13 13:23:38.000000000 +0100 +++ gcc/genmultilib 2013-03-07 11:35:22.881982721 +0100 @@ -267,6 +267,7 @@ fi # names. toosdirnames= defaultosdirname= +defaultosdirname2= if [ -n "${multiarch}" ]; then defaultosdirname=::${multiarch} fi @@ -280,6 +281,13 @@ if [ -n "${osdirnames}" ]; then if [ -n "${multiarch}" ]; then defaultosdirname=${defaultosdirname}:${multiarch} fi + case "$defaultosdirname" in + ::*) ;; + *) + defaultosdirname2=${defaultosdirname} + defaultosdirname= + ;; + esac shift ;; *=*) @@ -352,6 +360,7 @@ for set in ${options}; do done optout=`echo ${optout} | sed -e 's/^ //'` echo "\".${defaultosdirname} ${optout};\"," +[ -n "${defaultosdirname2}" ] && echo "\".${defaultosdirname2} ${optout};\"," # This part of code convert an option combination to # its corresponding directory names.