From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2049) id 267CE3858015; Mon, 28 Feb 2022 12:09:36 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 267CE3858015 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Matthew Malcomson To: gcc-cvs@gcc.gnu.org Subject: [gcc(refs/vendors/ARM/heads/morello)] Temporary step to get multilib using a bit better X-Act-Checkin: gcc X-Git-Author: Matthew Malcomson X-Git-Refname: refs/vendors/ARM/heads/morello X-Git-Oldrev: aa52757d0a0d0b390510e857ea1485cbd2491aba X-Git-Newrev: 951e27d6191b20b18c0a1b948cbf9bbb9fecee79 Message-Id: <20220228120936.267CE3858015@sourceware.org> Date: Mon, 28 Feb 2022 12:09:36 +0000 (GMT) X-BeenThere: gcc-cvs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-cvs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Feb 2022 12:09:36 -0000 https://gcc.gnu.org/g:951e27d6191b20b18c0a1b948cbf9bbb9fecee79 commit 951e27d6191b20b18c0a1b948cbf9bbb9fecee79 Author: Matthew Malcomson 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