public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc(refs/vendors/ARM/heads/morello)] Temporary step to get multilib using a bit better
@ 2022-02-28 12:09 Matthew Malcomson
  0 siblings, 0 replies; only message in thread
From: Matthew Malcomson @ 2022-02-28 12:09 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:951e27d6191b20b18c0a1b948cbf9bbb9fecee79

commit 951e27d6191b20b18c0a1b948cbf9bbb9fecee79
Author: Matthew Malcomson <matthew.malcomson@arm.com>
Date:   Fri Feb 25 12:11:08 2022 +0000

    Temporary step to get multilib using a bit better
    
    This is a hack for the moment.  The approach we should use is to create
    a canonicalised version of the architecture string for choosing
    multilibs (similar to commit f58d03b5d did for arm).
    
    What we're doing here is artificially handling the particular
    architecture combination that glibc uses to build specially by linking
    that to the standard C64 multilib.
    
    N.b. we also need to update the `genmultilib` script.  This script
    turned a description of names into a pathname.  However, because we
    wanted to include a multilib option without it forming a directory path
    (we did not want the -march=morello+c64 option to be included as part of
    the path) a temporary in this script had multiple `/`s at the end of
    a directory and only removed one of them.
    
    The reason we only want `purecap` as a directory name is that the
    `purecap` part defines the ABI while the other architecture options are
    not the determining factor (we can have purecap with many different
    architecture options).
    
    This change removes all trailing `/`s, which stops a break in the glibc
    build scripts when using multilibs.

Diff:
---
 gcc/config/aarch64/t-aarch64 | 19 +++++++++++++++----
 gcc/genmultilib              |  2 +-
 2 files changed, 16 insertions(+), 5 deletions(-)

diff --git a/gcc/config/aarch64/t-aarch64 b/gcc/config/aarch64/t-aarch64
index a05eecd129d..a4b8ad86dda 100644
--- a/gcc/config/aarch64/t-aarch64
+++ b/gcc/config/aarch64/t-aarch64
@@ -159,10 +159,21 @@ aarch64-bti-insert.o: $(srcdir)/config/aarch64/aarch64-bti-insert.c \
 		$(srcdir)/config/aarch64/aarch64-bti-insert.c
 
 comma=,
-MULTILIB_OPTIONS    = $(subst $(comma),/, $(patsubst %, mabi=%, $(subst $(comma),$(comma)mabi=,$(TM_MULTILIB_CONFIG)))) march=morello+c64
-MULTILIB_EXCEPTIONS = mabi=*lp*/march=morello+c64
-MULTILIB_EXCEPTIONS += mabi=purecap
-MULTILIB_EXCEPTIONS += march=morello+c64
+MULTILIB_OPTIONS    = $(subst $(comma),/, $(patsubst %, mabi=%, $(subst $(comma),$(comma)mabi=,$(TM_MULTILIB_CONFIG)))) march=morello+c64 march=morello+c64+nolse
+MULTILIB_REQUIRED   = mabi=ilp32
+MULTILIB_REQUIRED   += mabi=lp64
+MULTILIB_REQUIRED   += mabi=purecap/march=morello+c64
+# MORELLO TODO This is a bit of an ugly approach.  We want to say "ignore any
+# extra architecture extensions other than the +c64 extension when deciding
+# which multilib to use".  This statement below says "the option
+# `march=morello+c64+nolse` is the same as the option `march=morello+c64`".
+# Those statements are not the same.
+#
+# The approach I expect would be best would be to add something like Srinaths
+# patch for Arm to ignore the `cdecp` arguments (see commit f58d03b5d).  That
+# would take a while and we're still working out the building stuff so we're
+# leaving it for now.
+MULTILIB_REUSE      = mabi.purecap/march.morello+c64=mabi.purecap/march.morello+c64+nolse
 MULTILIB_DIRNAMES   = $(subst $(comma), ,$(TM_MULTILIB_CONFIG))
 
 insn-conditions.md: s-check-sve-md
diff --git a/gcc/genmultilib b/gcc/genmultilib
old mode 100644
new mode 100755
index 292ecc4e20d..36fbd3bb880
--- a/gcc/genmultilib
+++ b/gcc/genmultilib
@@ -382,7 +382,7 @@ else
   dirout=`echo ${combo} | sed -e 's/=/-/g'`
 fi
 # Remove the leading and trailing slashes.
-dirout=`echo ${dirout} | sed -e 's|^/||' -e 's|/*:/*|:|' -e 's|/$||g'`
+dirout=`echo ${dirout} | sed -e 's|^/*||' -e 's|/*:/*|:|' -e 's|/*$||g'`
 
 # Use the OS directory names rather than the option names.
 if [ -n "${toosdirnames}" ]; then


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-02-28 12:09 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-02-28 12:09 [gcc(refs/vendors/ARM/heads/morello)] Temporary step to get multilib using a bit better Matthew Malcomson

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