Fwd: question about incorrect command format in Scons
Bill Deegan <[email protected]> Tue, 13 Jun 2023 12:02:34 -0700
| Newsgroups | gmane.comp.programming.tools.scons.user |
|---|---|
| Message-ID | <CAEyG4CGTJ3UYpuPB1VNmAgcWVwGoW-6t0X8VvdWs=YiGdsyLQg@mail.gmail.com> |
Email mistakenly sent to scons-dev-owner.. ---------- Forwarded message --------- From: Bill Deegan <[email protected]> Date: Mon, Jun 12, 2023 at 10:05 PM Subject: Re: question about incorrect command format in Scons To: mzhou <[email protected]> Cc: <[email protected]> Please send to scons users mailing list On Mon, Jun 12, 2023 at 12:43 AM mzhou <[email protected]> wrote: > Hi > I have been trying to build an ARM-GCC Cortex-M0 compilation and linking environment using SCons on Windows. However, I encountered an issue > when > modifying the necessary compilation and linking variables through the SCons custom Tool in the generate interface. > ------------------------------ > #arm-gcc.py > def generate(env): > env['CC'] = 'arm-none-eabi-gcc' > env['CXX'] = 'arm-none-eabi-g++' > env['AS'] = 'arm-none-eabi-gcc' > env['AR'] = 'arm-none-eabi-gcc-ar' > env['OBJDUMP'] = 'arm-none-eabi-objdump' > env['OBJCOPY'] = 'arm-none-eabi-objcopy' > env['NM'] = 'arm-none-eabi-nm' > env['READELF'] = 'arm-none-eabi-readelf' > env['PROGSUFFIX'] = '.elf' > # env['OBJSUFFIX'] = '.o' > > def exists(env): > return True > ------------------------------ > In Sconscript, Tool is used like: > ------------------------------ > #Sconscript > tool = ARGUMENTS.get('tool','arm-gcc') > env.Tool(tool,toolpath = ['$SDK_ROOT/tools']) > if tool == 'arm-gcc': > env['COMPILER'] = 'gnu' > > env['CCFLAGS'] = ' -mabi=aapcs -mthumb -mcpu=$CPU -mno-unaligned-access -fshort-enums -fshort-wchar -g -ffunction-sections -fdata-sections -fstrict-volatile-bitfields -fno-common -Wall ' > env['CFLAGS'] = ' -std=c11 ' > env['CXXFLAGS'] = ' -fno-exceptions ' > env['ASFLAGS'] = ' -c ${CCFLAGS} ${_CPPDEFFLAGS} ' > > env['LINKFLAGS'] = ' -mcpu=$CPU -g -specs=nosys.specs -specs=nano.specs -T ${LINKSCRIPT} -Wl,--print-memory-usage -Wl,-Map=${TARGET.base}.map -Wl,--cref -Wl,--no-wchar-size-warning -Wl,--no-enum-size-warning ' > env['GC_OPTION'] = ' -Wl,--gc-sections ' > ------------------------------ > When running Scons, the compiling format seems incorrect: > > > arm-none-eabi-gcc /Fobuild\device\__\__\__\__\soc\arm_cm\svcall.obj /c D:\code\SDK\soc\arm_cm\svcall.c -std=c11 -mabi=aapcs -mthumb -mcpu=cortex-m0 -mno-unaligned-access -fshort-enums -fshort-wchar -g -ffunction-sections -fdata-sections -fstrict-volatile-bitfields -fno-common -Wall -Os > > It should be like: > > arm-none-eabi-gcc -o build\device\__\__\__\__\soc\arm_cm\svcall.o -c -std=c11 -mabi=aapcs -mthumb -mcpu=cortex-m0 -mno-unaligned-access -fshort-enums -fshort-wchar -g -ffunction-sections -fdata-sections -fstrict-volatile-bitfields -fno-common -Wall -Os D:\code\SDK\soc\arm_cm\svcall.c > > > It seems that my compilation command format is incorrect, as SCons is using the Windows platform's compilation command format (/Fo). I would like to know how to handle this situation. > > I have attempted to read all available documentation on SCons and searched relevant issues on Google, but I have not been able to find an answer. > Looking forward to your answer, thanks a lot~ > > _______________________________________________ Scons-users mailing list [email protected] https://pairlist4.pair.net/mailman/listinfo/scons-users