1 # Copyright (C) 2012-2018 Free Software Foundation, Inc.
3 # This file is part of GCC.
5 # GCC is free software; you can redistribute it and/or modify
6 # it under the terms of the GNU General Public License as published by
7 # the Free Software Foundation; either version 3, or (at your option)
10 # GCC is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 # GNU General Public License for more details.
15 # You should have received a copy of the GNU General Public License
16 # along with GCC; see the file COPYING3. If not see
17 # <http://www.gnu.org/licenses/>.
19 # This is a target makefile fragment that attempts to get
20 # multilibs built for the range of CPU's, FPU's and ABI's that
21 # are relevant for the A-profile architecture. It should
22 # not be used in conjunction with another make file fragment and
23 # assumes --with-arch, --with-cpu, --with-fpu, --with-float, --with-mode
24 # have their default values during the configure step. We enforce
25 # this during the top-level configury.
27 # Arch and FPU variants to build libraries with
29 MULTI_ARCH_OPTS_A = march=armv7-a/march=armv7-a+fp/march=armv7-a+simd/march=armv7ve+simd/march=armv8-a/march=armv8-a+simd
30 MULTI_ARCH_DIRS_A = v7-a v7-a+fp v7-a+simd v7ve+simd v8-a v8-a+simd
32 # ARMv7-A - build nofp, fp-d16 and SIMD variants
34 MULTILIB_REQUIRED += mthumb/march=armv7-a/mfloat-abi=soft
35 MULTILIB_REQUIRED += mthumb/march=armv7-a+fp/mfloat-abi=hard
36 MULTILIB_REQUIRED += mthumb/march=armv7-a+fp/mfloat-abi=softfp
37 MULTILIB_REQUIRED += mthumb/march=armv7-a+simd/mfloat-abi=hard
38 MULTILIB_REQUIRED += mthumb/march=armv7-a+simd/mfloat-abi=softfp
40 # ARMv7VE - only build a SIMD (+VFPv4) variant.
41 MULTILIB_REQUIRED += mthumb/march=armv7ve+simd/mfloat-abi=hard
42 MULTILIB_REQUIRED += mthumb/march=armv7ve+simd/mfloat-abi=softfp
44 # ARMv8-A - build nofp and SIMD variants.
45 MULTILIB_REQUIRED += mthumb/march=armv8-a/mfloat-abi=soft
46 MULTILIB_REQUIRED += mthumb/march=armv8-a+simd/mfloat-abi=hard
47 MULTILIB_REQUIRED += mthumb/march=armv8-a+simd/mfloat-abi=softfp
52 # Map all v7-a FP variants to vfpv3-d16 (+fp)
53 MULTILIB_MATCHES += $(foreach ARCH, $(filter-out +fp, $(v7_a_nosimd_variants)), \
54 march?armv7-a+fp=march?armv7-a$(ARCH))
56 # Map all v7-a SIMD variants to neon-vfpv3 (+simd)
57 MULTILIB_MATCHES += $(foreach ARCH, $(filter-out +simd, $(v7_a_simd_variants)), \
58 march?armv7-a+simd=march?armv7-a$(ARCH))
60 # Neither FP nor SIMD: map v7ve to v7-a
61 MULTILIB_MATCHES += march?armv7-a=march?armv7ve
63 # ARMv7ve FP-only variants: map down to v7-a+fp
64 MULTILIB_MATCHES += $(foreach ARCH, $(v7ve_nosimd_variants), \
65 march?armv7-a+fp=march?armv7ve$(ARCH))
67 # ARMv7ve with SIMD, but SIMD is less capable than the default - map down to v7-a+simd
68 MULTILIB_MATCHES += $(foreach ARCH, $(v7ve_vfpv3_simd_variants), \
69 march?armv7-a+simd=march?armv7ve$(ARCH))
71 # ARMv8 without SIMD: map down to base architecture
72 MULTILIB_MATCHES += $(foreach ARCH, $(v8_a_nosimd_variants), \
73 march?armv8-a=march?armv8-a$(ARCH))
75 # ARMv8 with SIMD: map down to base arch + simd
76 MULTILIB_MATCHES += march?armv8-a+simd=march?armv8-a+crc+simd \
77 $(foreach ARCH, $(filter-out +simd, $(v8_a_simd_variants)), \
78 march?armv8-a+simd=march?armv8-a$(ARCH) \
79 march?armv8-a+simd=march?armv8-a+crc$(ARCH))
81 # Baseline v8.1-a: map down to baseline v8-a
82 MULTILIB_MATCHES += march?armv8-a=march?armv8.1-a
84 # Map all v8.1-a SIMD variants to v8-a+simd
85 MULTILIB_MATCHES += $(foreach ARCH, $(v8_1_a_simd_variants), \
86 march?armv8-a+simd=march?armv8.1-a$(ARCH))
88 # Baseline v8.2-a: map down to baseline v8-a
89 MULTILIB_MATCHES += march?armv8-a=march?armv8.2-a
91 # Baseline v8.3-a: map down to baseline v8-a
92 MULTILIB_MATCHES += march?armv8-a=march?armv8.3-a
94 # Map all v8.2-a and v8.3-a SIMD variants to v8-a+simd
95 MULTILIB_MATCHES += $(foreach ARCH, $(v8_2_a_simd_variants), \
96 march?armv8-a+simd=march?armv8.2-a$(ARCH) \
97 march?armv8-a+simd=march?armv8.3-a$(ARCH))
99 # Baseline v8.4-a: map down to baseline v8-a
100 MULTILIB_MATCHES += march?armv8-a=march?armv8.4-a
102 # Map all v8.4-a SIMD variants to v8-a+simd
103 MULTILIB_MATCHES += $(foreach ARCH, $(v8_4_a_simd_variants), \
104 march?armv8-a+simd=march?armv8.4-a$(ARCH))
106 # Use Thumb libraries for everything.
108 MULTILIB_REUSE += mthumb/march.armv7-a/mfloat-abi.soft=marm/march.armv7-a/mfloat-abi.soft
110 MULTILIB_REUSE += mthumb/march.armv8-a/mfloat-abi.soft=marm/march.armv8-a/mfloat-abi.soft
112 MULTILIB_REUSE += $(foreach ABI, hard softfp, \
113 $(foreach ARCH, armv7-a+fp armv7-a+simd armv7ve+simd armv8-a+simd, \
114 mthumb/march.$(ARCH)/mfloat-abi.$(ABI)=marm/march.$(ARCH)/mfloat-abi.$(ABI)))
116 # Softfp but no FP, use the soft-float libraries.
117 MULTILIB_REUSE += $(foreach MODE, arm thumb, \
118 $(foreach ARCH, armv7-a armv8-a, \
119 mthumb/march.$(ARCH)/mfloat-abi.soft=m$(MODE)/march.$(ARCH)/mfloat-abi.softfp))