@@ -102,13 +102,15 @@ def __init__(self, name, os, arch):
102
102
self .is_x86_64 = self .arch in ('x86_64' , 'amd64' )
103
103
self .is_intel = self .is_x86 or self .is_x86_64
104
104
105
+ self .is_armv6 = self .arch in ('armv6hf' ,)
105
106
self .is_armv7 = self .arch in ('armv7' , 'armv7a' , 'armv7ahf' , 'armv7a_neon' , 'arm' , 'armv7a_cortex_a9' , 'armv7ahf_cortex_a35' , 'armv7ahf_cortex_a53' )
106
107
self .is_armv8 = self .arch in ('armv8' , 'armv8a' , 'arm64' , 'aarch64' , 'armv8a_cortex_a35' , 'armv8a_cortex_a53' )
107
108
self .is_armv8m = self .arch in ('armv8m_cortex_m33' , 'armv8m_cortex_m23' )
108
109
self .is_armv7em = self .arch in ('armv7em_cortex_m4' , 'armv7em_cortex_m7' )
109
110
self .is_arm64 = self .arch in ('arm64' ,)
110
- self .is_arm = self .is_armv7 or self .is_armv8 or self .is_armv8m or self .is_armv7em
111
+ self .is_arm = self .is_armv6 or self . is_armv7 or self .is_armv8 or self .is_armv8m or self .is_armv7em
111
112
self .is_armv7_neon = self .arch in ('armv7a_neon' , 'armv7ahf' , 'armv7a_cortex_a9' , 'armv7ahf_cortex_a35' , 'armv7ahf_cortex_a53' )
113
+ self .is_armv6hf = self .arch in ('armv6hf' ,)
112
114
self .is_armv7hf = self .arch in ('armv7ahf' , 'armv7ahf_cortex_a35' , 'armv7ahf_cortex_a53' )
113
115
self .is_armv5te = self .arch in ('armv5te_arm968e_s' ,)
114
116
@@ -124,6 +126,8 @@ def __init__(self, name, os, arch):
124
126
self .is_xtensa_hifi5 = self .arch == 'xtensa_hifi5'
125
127
self .is_xtensa = self .is_xtensa_hifi4 or self .is_xtensa_hifi5
126
128
129
+ self .armv6_float_abi = 'hard'
130
+
127
131
self .armv7_float_abi = None
128
132
if self .is_armv7 :
129
133
if self .is_armv7hf :
@@ -148,7 +152,11 @@ def __init__(self, name, os, arch):
148
152
self .is_wasm64 = self .arch == 'wasm64'
149
153
self .is_wasm = self .is_wasm32 or self .is_wasm64
150
154
151
- self .is_32_bit = self .is_x86 or self .is_armv5te or self .is_armv7 or self .is_armv8m or self .is_riscv32 or self .is_nds32 or self .is_armv7em or self .is_xtensa or self .is_tc32 or self .is_wasm32
155
+ self .is_32_bit = (
156
+ self .is_x86 or
157
+ self .is_armv5te or self .is_armv6 or self .is_armv7 or self .is_armv7em or self .is_armv8m or
158
+ self .is_riscv32 or self .is_nds32 or self .is_xtensa or self .is_tc32 or self .is_wasm32
159
+ )
152
160
self .is_64_bit = self .is_x86_64 or self .is_armv8 or self .is_powerpc or self .is_wasm64
153
161
154
162
assert self .is_32_bit or self .is_64_bit
@@ -216,6 +224,7 @@ def arch_variables(self):
216
224
(self .is_i386 or self .is_i686 , 'ARCH_I386' ),
217
225
(self .is_i686 , 'ARCH_I686' ),
218
226
(self .is_x86_64 , 'ARCH_X86_64' ),
227
+ (self .is_armv6 , 'ARCH_ARM6' ),
219
228
(self .is_armv7 , 'ARCH_ARM7' ),
220
229
(self .is_armv7_neon , 'ARCH_ARM7_NEON' ),
221
230
(self .is_armv8 , 'ARCH_ARM64' ),
@@ -827,6 +836,9 @@ def print_target_settings(self):
827
836
for variable in self .platform .os_variables :
828
837
emit (variable , 'yes' )
829
838
839
+ if self .platform .is_armv6 :
840
+ emit ('ARM6_FLOAT_ABI' , self .platform .armv6_float_abi )
841
+
830
842
if self .platform .is_armv7 :
831
843
emit ('ARM7_FLOAT_ABI' , self .platform .armv7_float_abi )
832
844
@@ -1195,6 +1207,7 @@ def get_os_sdk(target):
1195
1207
target_triple = select (default = None , selectors = [
1196
1208
(target .is_linux and target .is_x86_64 , 'x86_64-linux-gnu' ),
1197
1209
(target .is_linux and target .is_armv8 , 'aarch64-linux-gnu' ),
1210
+ (target .is_linux and target .is_armv6 and target .armv6_float_abi == 'hard' , 'armv6-linux-gnueabihf' ),
1198
1211
(target .is_linux and target .is_armv7 and target .armv7_float_abi == 'hard' , 'armv7-linux-gnueabihf' ),
1199
1212
(target .is_linux and target .is_armv7 and target .armv7_float_abi == 'softfp' , 'armv7-linux-gnueabi' ),
1200
1213
(target .is_linux and target .is_powerpc , 'powerpc64le-linux-gnu' ),
@@ -1258,13 +1271,16 @@ def get_os_sdk(target):
1258
1271
elif target .is_cortex_m33 :
1259
1272
self .c_flags_platform .append ('-mcpu=cortex-m33 -mfpu=fpv5-sp-d16' )
1260
1273
1274
+ elif target .is_armv6hf :
1275
+ self .c_flags_platform .append ('-march=armv6 -mfpu=vfp' )
1276
+
1261
1277
elif target .is_armv7_neon :
1262
1278
self .c_flags_platform .append ('-mfpu=neon' )
1263
1279
1264
1280
elif target .is_arm968e_s :
1265
1281
self .c_flags_platform .append ('-march=armv5te -mcpu=arm968e-s -mthumb-interwork -mlittle-endian' )
1266
1282
1267
- if (target .is_armv7 or target .is_armv8m or target .is_armv7em or target .is_armv5te ) and build .is_size_optimized :
1283
+ if (target .is_armv6 or target . is_armv7 or target .is_armv8m or target .is_armv7em or target .is_armv5te ) and build .is_size_optimized :
1268
1284
# Enable ARM Thumb2 variable-length instruction encoding
1269
1285
# to reduce code size
1270
1286
self .c_flags_platform .append ('-mthumb' )
0 commit comments