From: Jakub Jelinek <jakub@redhat.com>
To: Marcus Shawcroft <marcus.shawcroft@arm.com>,
Paolo Bonzini <bonzini@gnu.org>,
Alexandre Oliva <aoliva@redhat.com>,
Matthias Klose <doko@ubuntu.com>
Cc: gcc-patches@gcc.gnu.org
Subject: [PATCH] Fix -print-multi-os-directory for aarch64
Date: Thu, 07 Mar 2013 11:15:00 -0000 [thread overview]
Message-ID: <20130307111536.GA12913@tucnak.redhat.com> (raw)
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 <jakub@redhat.com>
* 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
next reply other threads:[~2013-03-07 11:15 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-03-07 11:15 Jakub Jelinek [this message]
2013-03-07 16:29 ` Andrew Pinski
2013-03-07 16:45 ` Jakub Jelinek
2013-03-08 9:04 ` Marcus Shawcroft
2013-03-08 9:33 ` Jakub Jelinek
2013-03-14 8:37 ` Marcus Shawcroft
2013-03-14 18:07 ` Matthias Klose
2013-03-14 18:26 ` Jakub Jelinek
2013-03-13 16:12 ` Andrew Pinski
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20130307111536.GA12913@tucnak.redhat.com \
--to=jakub@redhat.com \
--cc=aoliva@redhat.com \
--cc=bonzini@gnu.org \
--cc=doko@ubuntu.com \
--cc=gcc-patches@gcc.gnu.org \
--cc=marcus.shawcroft@arm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).