From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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, 07 Mar 2013 11:15:00 -0000 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-Type: text/plain; charset=us-ascii 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-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org X-SW-Source: 2013-03/txt/msg00288.txt.bz2 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. --- 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. Jakub