aboutsummaryrefslogtreecommitdiff
path: root/gcc/config/arm/t-arm-elf
blob: f7fc1460d1cd3f8963a3518dfe8a65cfd31fde78 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
# Copyright (C) 1998-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/>.

# Build a very basic set of libraries that should cater for most cases.

# Single-precision floating-point is NOT supported; we don't build a
# suitable library for that.  Use the rm-profile config in that case.

# PART 1 - Useful groups of options

dp_fpus		:= vfp vfpv2 vfpv3 vfpv3-fp16 vfpv3-d16 vfpv3-d16-fp16 \
		   neon neon-vfpv3 neon-fp16 vfpv4 neon-vfpv4 vfpv4-d16 \
		   fpv5-d16 fp-armv8 neon-fp-armv8 crypto-neon-fp-armv8 \
		   vfp3

sp_fpus		:= vfpv3xd vfpv3xd-fp16  fpv4-sp-d16 fpv5-sp-d16

v7a_fps		:= vfpv3 vfpv3-fp16 vfpv4 simd neon-fp16 neon-vfpv4
v7ve_fps	:= vfpv3-d16 vfpv3 vfpv3-d16-fp16 vfpv3-fp16 vfpv4 neon \
		   neon-fp16 simd

# Not all these permutations exist for all architecture variants, but
# it seems to work ok.
v8_fps		:= simd fp16 crypto fp16+crypto dotprod fp16fml

v9_fps		:= simd fp16 crypto fp16+crypto dotprod fp16fml

# We don't do anything special with these.  Pre-v4t probably doesn't work.
all_early_nofp	:= armv4 armv4t armv5t

all_early_arch	:= armv5tej armv6 armv6j armv6k armv6z armv6kz \
		   armv6zk armv6t2 iwmmxt iwmmxt2

all_v7_a_r	:= armv7-a armv7ve armv7-r

all_v8_archs	:= armv8-a armv8-a+crc armv8.1-a armv8.2-a armv8.3-a armv8.4-a \
		   armv8.5-a armv8.6-a

all_v9_archs	:= armv9-a

# No floating point variants, require thumb1 softfp
all_nofp_t	:= armv6-m armv6s-m armv8-m.base

all_nofp_t2	:= armv7-m

all_sp_only	:= armv7e-m armv8-m.main

MULTILIB_OPTIONS     =
MULTILIB_DIRNAMES    =
MULTILIB_EXCEPTIONS  = 
MULTILIB_MATCHES     =
MULTILIB_REUSE	     =

# PART 2 - multilib build rules

MULTILIB_OPTIONS     += marm/mthumb
MULTILIB_DIRNAMES    += arm thumb

MULTILIB_OPTIONS     += mfpu=auto
MULTILIB_DIRNAMES    += autofp

MULTILIB_OPTIONS     += march=armv5te+fp/march=armv7+fp
MULTILIB_DIRNAMES    += v5te v7

MULTILIB_OPTIONS     += mfloat-abi=hard
MULTILIB_DIRNAMES    += fpu

# Build a total of 4 library variants (base options plus the following):
MULTILIB_REQUIRED    += mthumb
MULTILIB_REQUIRED    += marm/mfpu=auto/march=armv5te+fp/mfloat-abi=hard
MULTILIB_REQUIRED    += mthumb/mfpu=auto/march=armv7+fp/mfloat-abi=hard

# PART 3 - Match rules

# Map all supported FPUs onto mfpu=auto
MULTILIB_MATCHES     += $(foreach FPU, $(dp_fpus), \
			  mfpu?auto=mfpu?$(FPU))

MULTILIB_MATCHES     += march?armv5te+fp=march?armv5te

MULTILIB_MATCHES     += $(foreach ARCH, $(all_early_arch), \
		          march?armv5te+fp=march?$(ARCH) \
			  march?armv5te+fp=march?$(ARCH)+fp)

MULTILIB_MATCHES     += march?armv7+fp=march?armv7

MULTILIB_MATCHES     += $(foreach FPARCH, $(v7a_fps), \
		          march?armv7+fp=march?armv7-a+$(FPARCH))

MULTILIB_MATCHES     += $(foreach FPARCH, $(v7ve_fps), \
		          march?armv7+fp=march?armv7ve+$(FPARCH))

MULTILIB_MATCHES     += $(foreach ARCH, $(all_v7_a_r), \
			  march?armv7+fp=march?$(ARCH) \
			  march?armv7+fp=march?$(ARCH)+fp)

MULTILIB_MATCHES     += $(foreach ARCH, $(all_v8_archs), \
			  march?armv7+fp=march?$(ARCH) \
			  $(foreach FPARCH, $(v8_fps), \
			    march?armv7+fp=march?$(ARCH)+$(FPARCH)))

MULTILIB_MATCHES     += $(foreach ARCH, $(all_v9_archs), \
			  march?armv7+fp=march?$(ARCH) \
			  $(foreach FPARCH, $(v9_fps), \
			    march?armv7+fp=march?$(ARCH)+$(FPARCH)))

MULTILIB_MATCHES     += $(foreach ARCH, armv7e-m armv8-m.mainline, \
			  march?armv7+fp=march?$(ARCH)+fp.dp)

# PART 4 - Reuse rules

MULTILIB_REUSE	     += mthumb=mthumb/mfpu.auto
MULTILIB_REUSE	     += mthumb=mthumb/mfpu.auto/march.armv5te+fp
MULTILIB_REUSE	     += mthumb=mthumb/march.armv5te+fp
MULTILIB_REUSE	     += marm/mfpu.auto/march.armv5te+fp/mfloat-abi.hard=marm/march.armv5te+fp/mfloat-abi.hard
MULTILIB_REUSE	     += marm/mfpu.auto/march.armv5te+fp/mfloat-abi.hard=march.armv5te+fp/mfloat-abi.hard
MULTILIB_REUSE	     += marm/mfpu.auto/march.armv5te+fp/mfloat-abi.hard=mfpu.auto/march.armv5te+fp/mfloat-abi.hard
MULTILIB_REUSE	     += mthumb/mfpu.auto/march.armv7+fp/mfloat-abi.hard=mthumb/march.armv7+fp/mfloat-abi.hard
MULTILIB_REUSE	     += mthumb/mfpu.auto/march.armv7+fp/mfloat-abi.hard=mfpu.auto/march.armv7+fp/mfloat-abi.hard
MULTILIB_REUSE	     += mthumb/mfpu.auto/march.armv7+fp/mfloat-abi.hard=march.armv7+fp/mfloat-abi.hard