waf: fixed build on cygwin

this fixes a link error on cygwin with the new DSP libs
This commit is contained in:
Andrew Tridgell 2020-02-22 15:30:49 +11:00 committed by Peter Barker
parent 194998d631
commit de791682e9
2 changed files with 11 additions and 7 deletions

View File

@ -526,7 +526,6 @@ class chibios(Board):
'-L%s' % env.BUILDROOT, '-L%s' % env.BUILDROOT,
'-L%s' % cfg.srcnode.make_node('modules/ChibiOS/os/common/startup/ARMCMx/compilers/GCC/ld/').abspath(), '-L%s' % cfg.srcnode.make_node('modules/ChibiOS/os/common/startup/ARMCMx/compilers/GCC/ld/').abspath(),
'-L%s' % cfg.srcnode.make_node('libraries/AP_HAL_ChibiOS/hwdef/common/').abspath(), '-L%s' % cfg.srcnode.make_node('libraries/AP_HAL_ChibiOS/hwdef/common/').abspath(),
'-L%s' % cfg.srcnode.make_node('libraries/AP_GyroFFT/CMSIS_5/lib/').abspath(),
'-Wl,--gc-sections,--no-warn-mismatch,--library-path=/ld,--script=ldscript.ld,--defsym=__process_stack_size__=%s,--defsym=__main_stack_size__=%s' % (cfg.env.PROCESS_STACK, cfg.env.MAIN_STACK) '-Wl,--gc-sections,--no-warn-mismatch,--library-path=/ld,--script=ldscript.ld,--defsym=__process_stack_size__=%s,--defsym=__main_stack_size__=%s' % (cfg.env.PROCESS_STACK, cfg.env.MAIN_STACK)
] ]

View File

@ -420,12 +420,17 @@ def build(bld):
target=bld.bldnode.find_or_declare('modules/ChibiOS/libch.a') target=bld.bldnode.find_or_declare('modules/ChibiOS/libch.a')
) )
ch_task.name = "ChibiOS_lib" ch_task.name = "ChibiOS_lib"
if bld.env.CORTEX == 'cortex-m4': DSP_LIBS = {
bld.env.LIB += ['ch', 'arm_cortexM4lf_math'] 'cortex-m4' : 'libarm_cortexM4lf_math.a',
elif bld.env.CORTEX == 'cortex-m7': 'cortex-m7' : 'libarm_cortexM7lfdp_math.a',
bld.env.LIB += ['ch', 'arm_cortexM7lfdp_math'] }
else: if bld.env.CORTEX in DSP_LIBS:
bld.env.LIB += ['ch'] libname = DSP_LIBS[bld.env.CORTEX]
# we need to copy the library on cygwin as it doesn't handle linking outside build tree
shutil.copyfile(os.path.join(bld.env.SRCROOT,'libraries/AP_GyroFFT/CMSIS_5/lib',libname),
os.path.join(bld.env.BUILDROOT,'modules/ChibiOS/libDSP.a'))
bld.env.LIB += ['DSP']
bld.env.LIB += ['ch']
bld.env.LIBPATH += ['modules/ChibiOS/'] bld.env.LIBPATH += ['modules/ChibiOS/']
# list of functions that will be wrapped to move them out of libc into our # list of functions that will be wrapped to move them out of libc into our
# own code note that we also include functions that we deliberately don't # own code note that we also include functions that we deliberately don't