@@ -215,18 +215,22 @@ def process_dsp_lib():
215215 )
216216
217217
218- env .Replace (AS = "$CC" , ASCOM = "$ASPPCOM" )
218+ machine_flags = [
219+ "-mthumb" ,
220+ "-mcpu=%s" % board .get ("build.cpu" ),
221+ ]
219222
220223env .Append (
221- ASFLAGS = ["-x" , "assembler-with-cpp" ],
224+ ASFLAGS = machine_flags ,
225+ ASPPFLAGS = [
226+ "-x" , "assembler-with-cpp" ,
227+ ],
222228
223- CCFLAGS = [
229+ CCFLAGS = machine_flags + [
224230 "-Os" , # optimize for size
225231 "-ffunction-sections" , # place each function in its own section
226232 "-fdata-sections" ,
227233 "-Wall" ,
228- "-mthumb" ,
229- "-mcpu=%s" % board .get ("build.cpu" ),
230234 "-nostdlib" ,
231235 ],
232236
@@ -267,11 +271,9 @@ def process_dsp_lib():
267271 "-fno-exceptions"
268272 ],
269273
270- LINKFLAGS = [
274+ LINKFLAGS = machine_flags + [
271275 "-Os" ,
272276 "-Wl,--gc-sections,--relax" ,
273- "-mthumb" ,
274- "-mcpu=%s" % board .get ("build.cpu" ),
275277 "--specs=nano.specs" ,
276278 "--specs=nosys.specs" ,
277279 ],
@@ -283,9 +285,6 @@ def process_dsp_lib():
283285 LIBS = ["c" , "gcc" , "m" , "stdc++" , "nosys" ],
284286)
285287
286- # copy CCFLAGS to ASFLAGS (-x assembler-with-cpp mode)
287- env .Append (ASFLAGS = env .get ("CCFLAGS" , [])[:])
288-
289288if not board .get ("build.ldscript" , "" ):
290289 env .Replace (LDSCRIPT_PATH = get_linker_script (
291290 board .get ("build.mcu" , "" ), board .get ("build.cpu" , "" )))
0 commit comments