(root)/
gcc-13.2.0/
gcc/
config/
arm/
t-rmprofile
# Copyright (C) 2016-2023 Free Software Foundation, Inc.
#
# This file is part of GCC.
#
# GCC is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3, or (at your option)
# any later version.
#
# GCC is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with GCC; see the file COPYING3.  If not see
# <http://www.gnu.org/licenses/>.

# This is a target makefile fragment that attempts to get
# multilibs built for the range of CPU's, FPU's and ABI's that
# are relevant for the ARM architecture.  It should not be used in
# conjunction with another make file fragment and assumes --with-arch,
# --with-cpu, --with-fpu, --with-float, --with-mode have their default
# values during the configure step.  We enforce this during the
# top-level configury.


# Arch and FPU variants to build libraries with

MULTI_ARCH_OPTS_RM	= march=armv6s-m/march=armv7-m/march=armv7e-m/march=armv7e-m+fp/march=armv7e-m+fp.dp/march=armv8-m.base/march=armv8-m.main/march=armv8-m.main+fp/march=armv8-m.main+fp.dp/march=armv8.1-m.main+mve/march=armv8.1-m.main+pacbti/march=armv8.1-m.main+pacbti+fp/march=armv8.1-m.main+pacbti+fp.dp/march=armv8.1-m.main+pacbti+mve
MULTI_ARCH_DIRS_RM	= v6-m v7-m v7e-m v7e-m+fp v7e-m+dp v8-m.base v8-m.main v8-m.main+fp v8-m.main+dp v8.1-m.main+mve v8.1-m.main+pacbti v8.1-m.main+pacbti+fp v8.1-m.main+pacbti+dp v8.1-m.main+pacbti+mve

MULTI_ARCH_OPTS_RM	+= mbranch-protection=standard
MULTI_ARCH_DIRS_RM	+= bp

# Base M-profile (no fp)
MULTILIB_REQUIRED	+= mthumb/march=armv6s-m/mfloat-abi=soft
MULTILIB_REQUIRED	+= mthumb/march=armv7-m/mfloat-abi=soft
MULTILIB_REQUIRED	+= mthumb/march=armv7e-m/mfloat-abi=soft
MULTILIB_REQUIRED	+= mthumb/march=armv8-m.base/mfloat-abi=soft
MULTILIB_REQUIRED	+= mthumb/march=armv8-m.main/mfloat-abi=soft

# ARMv7e-M with FP (single and double precision variants)
MULTILIB_REQUIRED	+= mthumb/march=armv7e-m+fp/mfloat-abi=hard
MULTILIB_REQUIRED	+= mthumb/march=armv7e-m+fp/mfloat-abi=softfp
MULTILIB_REQUIRED	+= mthumb/march=armv7e-m+fp.dp/mfloat-abi=hard
MULTILIB_REQUIRED	+= mthumb/march=armv7e-m+fp.dp/mfloat-abi=softfp

# ARMv8-M with FP (single and double precision variants)
MULTILIB_REQUIRED	+= mthumb/march=armv8-m.main+fp/mfloat-abi=hard
MULTILIB_REQUIRED	+= mthumb/march=armv8-m.main+fp/mfloat-abi=softfp
MULTILIB_REQUIRED	+= mthumb/march=armv8-m.main+fp.dp/mfloat-abi=hard
MULTILIB_REQUIRED	+= mthumb/march=armv8-m.main+fp.dp/mfloat-abi=softfp
MULTILIB_REQUIRED	+= mthumb/march=armv8.1-m.main+mve/mfloat-abi=hard

MULTILIB_REQUIRED	+= mthumb/march=armv8.1-m.main+pacbti/mbranch-protection=standard/mfloat-abi=soft
MULTILIB_REQUIRED	+= mthumb/march=armv8.1-m.main+pacbti+fp/mbranch-protection=standard/mfloat-abi=softfp
MULTILIB_REQUIRED	+= mthumb/march=armv8.1-m.main+pacbti+fp/mbranch-protection=standard/mfloat-abi=hard
MULTILIB_REQUIRED	+= mthumb/march=armv8.1-m.main+pacbti+fp.dp/mbranch-protection=standard/mfloat-abi=softfp
MULTILIB_REQUIRED	+= mthumb/march=armv8.1-m.main+pacbti+fp.dp/mbranch-protection=standard/mfloat-abi=hard
MULTILIB_REQUIRED	+= mthumb/march=armv8.1-m.main+pacbti+mve/mbranch-protection=standard/mfloat-abi=hard

# Arch Matches
MULTILIB_MATCHES	+= march?armv6s-m=march?armv6-m

# For all MULITIB_MATCHES for v8-m and above add mlibarch? on the right hand side
# of = in the variant string instead of march?.  This is needed because all the
# MULITIB_MATCHES variant strings are compared with mlibarch option for multilib
# linking.

# Map all v8-m.main+dsp FP variants down to the variant without DSP.
MULTILIB_MATCHES	+= march?armv8-m.main=mlibarch?armv8-m.main+dsp \
			   $(foreach FP, +fp +fp.dp, \
			     march?armv8-m.main$(FP)=mlibarch?armv8-m.main+dsp$(FP))

# For single-precision only fpv5, use the base fp libraries
MULTILIB_MATCHES	+= march?armv7e-m+fp=march?armv7e-m+fpv5

# Softfp but no FP.  Use the soft-float libraries.
MULTILIB_REUSE		+= $(foreach ARCH, armv6s-m armv7-m armv7e-m armv8-m\.base armv8-m\.main, \
			     mthumb/march.$(ARCH)/mfloat-abi.soft=mthumb/march.$(ARCH)/mfloat-abi.softfp)

# Map v8.1-M to v8-M.
MULTILIB_MATCHES	+= march?armv8-m.main=mlibarch?armv8.1-m.main
MULTILIB_MATCHES	+= march?armv8-m.main=mlibarch?armv8.1-m.main+dsp
MULTILIB_REUSE		+= mthumb/march.armv8-m\.main/mfloat-abi.soft=mthumb/march.armv8\.1-m\.main+mve/mfloat-abi.soft
MULTILIB_REUSE		+= mthumb/march.armv8-m\.main/mfloat-abi.soft=mthumb/march.armv8\.1-m\.main+mve/mfloat-abi.softfp

v8_1m_sp_variants = +fp +dsp+fp +mve.fp +fp+mve
v8_1m_dp_variants = +fp.dp +dsp+fp.dp +fp.dp+mve +fp.dp+mve.fp

# Map all v8.1-m.main FP sp variants down to v8-m.
MULTILIB_MATCHES += $(foreach FP, $(v8_1m_sp_variants), \
			     march?armv8-m.main+fp=mlibarch?armv8.1-m.main$(FP))

# Map all v8.1-m.main FP dp variants down to v8-m.
MULTILIB_MATCHES += $(foreach FP, $(v8_1m_dp_variants), \
			     march?armv8-m.main+fp.dp=mlibarch?armv8.1-m.main$(FP))

# Map all mbranch-protection values other than 'none' to 'standard'.
MULTILIB_MATCHES	+= mbranch-protection?standard=mbranch-protection?bti
MULTILIB_MATCHES	+= mbranch-protection?standard=mbranch-protection?pac-ret
MULTILIB_MATCHES	+= mbranch-protection?standard=mbranch-protection?pac-ret+leaf
MULTILIB_MATCHES	+= mbranch-protection?standard=mbranch-protection?pac-ret+bti
MULTILIB_MATCHES	+= mbranch-protection?standard=mbranch-protection?pac-ret+leaf+bti
MULTILIB_MATCHES	+= mbranch-protection?standard=mbranch-protection?bti+pac-ret
MULTILIB_MATCHES	+= mbranch-protection?standard=mbranch-protection?bti+pac-ret+leaf
MULTILIB_MATCHES	+= mbranch-protection?standard=mbranch-protection?standard+leaf

# For all the MULTILIB_REQUIRED for v8-m and above, add MULTILIB_MATCHES which
# maps mlibarch with march for multilib linking.
MULTILIB_MATCHES	+= march?armv8-m.main=mlibarch?armv8-m.main
MULTILIB_MATCHES	+= march?armv8-m.main+fp=mlibarch?armv8-m.main+fp
MULTILIB_MATCHES	+= march?armv8-m.main+fp.dp=mlibarch?armv8-m.main+fp.dp
MULTILIB_MATCHES	+= march?armv8.1-m.main+mve=mlibarch?armv8.1-m.main+mve

# For -mbranch-protection=none and +pacbti reuses the existing non pacbti
# multilibs.
MULTILIB_REUSE		+= $(foreach OPT, fp fp\.dp, \
			     mthumb/march.armv8-m\.main+$(OPT)/mfloat-abi.softfp=mthumb/march.armv8\.1-m\.main+pacbti+$(OPT)/mfloat-abi.softfp)
MULTILIB_REUSE		+= $(foreach OPT, fp fp\.dp, \
			     mthumb/march.armv8-m\.main+$(OPT)/mfloat-abi.hard=mthumb/march.armv8\.1-m\.main+pacbti+$(OPT)/mfloat-abi.hard)

MULTILIB_REUSE		+= $(foreach OPT, pacbti pacbti+mve, \
			     mthumb/march.armv8-m\.main/mfloat-abi.soft=mthumb/march.armv8\.1-m\.main+$(OPT)/mfloat-abi.soft)
MULTILIB_REUSE		+= $(foreach OPT, pacbti pacbti+mve, \
			     mthumb/march.armv8-m\.main/mfloat-abi.soft=mthumb/march.armv8\.1-m\.main+$(OPT)/mfloat-abi.softfp)

MULTILIB_REUSE		+= mthumb/march.armv8\.1-m\.main+mve/mfloat-abi.hard=mthumb/march.armv8\.1-m\.main+pacbti+mve/mfloat-abi.hard

pacbti_fp_variants =  fp fp+mve mve.fp fp+mve.fp
pacbti_dp_variants = fp.dp fp.dp+mve fp.dp+mve.fp

# For -mbranch-protection=standard and +pacbti linking to existing pacbti
# multlibs.
MULTILIB_MATCHES	+= march?armv8.1-m.main+pacbti=mlibarch?armv8.1-m.main+pacbti
MULTILIB_MATCHES	+= march?armv8.1-m.main+pacbti=mlibarch?armv8.1-m.main+pacbti+dsp
MULTILIB_MATCHES	+= march?armv8.1-m.main+pacbti=mlibarch?armv8.1-m.main+dsp+pacbti
MULTILIB_MATCHES	+= march?armv8.1-m.main+pacbti+mve=mlibarch?armv8.1-m.main+pacbti+mve
MULTILIB_MATCHES	+= march?armv8.1-m.main+pacbti+mve=mlibarch?armv8.1-m.main+pacbti+dsp+mve
MULTILIB_MATCHES	+= march?armv8.1-m.main+pacbti+mve=mlibarch?armv8.1-m.main+dsp+pacbti+mve

MULTILIB_MATCHES	+= $(foreach OPT, $(pacbti_fp_variants), \
			     march?armv8.1-m.main+pacbti+fp=mlibarch?armv8.1-m.main+pacbti+$(OPT))

MULTILIB_MATCHES	+= $(foreach OPT, $(pacbti_fp_variants), \
			     march?armv8.1-m.main+pacbti+fp=mlibarch?armv8.1-m.main+pacbti+dsp+$(OPT))

MULTILIB_MATCHES	+= $(foreach OPT, $(pacbti_dp_variants), \
			     march?armv8.1-m.main+pacbti+fp.dp=mlibarch?armv8.1-m.main+pacbti+$(OPT))

MULTILIB_MATCHES	+= $(foreach OPT, $(pacbti_dp_variants), \
			     march?armv8.1-m.main+pacbti+fp.dp=mlibarch?armv8.1-m.main+pacbti+dsp+$(OPT))

MULTILIB_MATCHES	+= $(foreach OPT, $(pacbti_fp_variants), \
			     march?armv8.1-m.main+pacbti+fp=mlibarch?armv8.1-m.main+dsp+pacbti+$(OPT))

MULTILIB_MATCHES	+= $(foreach OPT, $(pacbti_dp_variants), \
			     march?armv8.1-m.main+pacbti+fp.dp=mlibarch?armv8.1-m.main+dsp+pacbti+$(OPT))