public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] Fix -print-multi-os-directory for aarch64
@ 2013-03-07 11:15 Jakub Jelinek
  2013-03-07 16:29 ` Andrew Pinski
  0 siblings, 1 reply; 9+ messages in thread
From: Jakub Jelinek @ 2013-03-07 11:15 UTC (permalink / raw)
  To: Marcus Shawcroft, Paolo Bonzini, Alexandre Oliva, Matthias Klose
  Cc: gcc-patches

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

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2013-03-14 18:26 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-03-07 11:15 [PATCH] Fix -print-multi-os-directory for aarch64 Jakub Jelinek
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

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).