You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
on_load(function (target)
localldscript="-T".."$(scriptdir)/misc/AT32F437xM_FLASH.ld"print(ldscript)
-- wrong-- target:add("ldflags",ldscript, { force = true })-- wrong-- target:add("ldflags","-T$(scriptdir)/misc/AT32F437xM_FLASH.ld", { force = true })-- oktarget:add("ldflags","-TD:\\works\\jobs\\threadx_at32\\bsp\\at32\\surf_f437\\misc\\AT32F437xM_FLASH.ld",{force=true})
end)
执行的时候会忽略掉这个添加项,给的信息如下:
D:\works\jobs\threadx_at32\bsp\at32\surf_f437/misc/AT32F437xM_FLASH.ld
warning: add_ldflags("-TD:\works\jobs\threadx_at32\bsp\at32\surf_f437/misc/AT32F437xM_FLASH.ld") is ignored, please pass `{force = true}` or call `set_policy("check.auto_ignore_flags", false)`if you want to set it.
checking for arm-none-eabi-gcc ... D:\Programs\gcc-arm-none-eabi-10.3-2021.10\bin\arm-none-eabi-gcc
checking for the c compiler (cc) ... arm-none-eabi-gcc
checking for the c compiler (cc) ... arm-none-eabi-gcc
checking for the c compiler (cc) ... arm-none-eabi-gcc
checking for the c compiler (cc) ... arm-none-eabi-gcc
checking for the c compiler (cc) ... arm-none-eabi-gcc
checking for the c compiler (cc) ... arm-none-eabi-gcc
checking for the c compiler (cc) ... arm-none-eabi-gcc
checking for the c compiler (cc) ... arm-none-eabi-gcc
checking for the c compiler (cc) ... arm-none-eabi-gcc
checking for the c compiler (cc) ... arm-none-eabi-gcc
checking for the c compiler (cc) ... arm-none-eabi-gcc
checking for the c compiler (cc) ... arm-none-eabi-gcc
checking for the c compiler (cc) ... arm-none-eabi-gcc
checking for the c compiler (cc) ... arm-none-eabi-gcc
checking for the c compiler (cc) ... arm-none-eabi-gcc
checking for the c compiler (cc) ... arm-none-eabi-gcc
checking for the c compiler (cc) ... arm-none-eabi-gcc
checking for the c compiler (cc) ... arm-none-eabi-gcc
checking for the c compiler (cc) ... arm-none-eabi-gcc
checking for the c compiler (cc) ... arm-none-eabi-gcc
checking for the c compiler (cc) ... arm-none-eabi-gcc
checking for the c compiler (cc) ... arm-none-eabi-gcc
checking for the c compiler (cc) ... arm-none-eabi-gcc
checking for the c compiler (cc) ... arm-none-eabi-gcc
checking for the c compiler (cc) ... arm-none-eabi-gcc
checking for the c compiler (cc) ... arm-none-eabi-gcc
checking for the c compiler (cc) ... arm-none-eabi-gcc
checking for the c compiler (cc) ... arm-none-eabi-gcc
checking for the c compiler (cc) ... arm-none-eabi-gcc
checking for the c compiler (cc) ... arm-none-eabi-gcc
checking for the c compiler (cc) ... arm-none-eabi-gcc
checking for the c compiler (cc) ... arm-none-eabi-gcc
checking for the c compiler (cc) ... arm-none-eabi-gcc
checking for the c compiler (cc) ... arm-none-eabi-gcc
checking for D:\Programs\gcc-arm-none-eabi-10.3-2021.10\bin\arm-none-eabi-gcc ... ok
checking for flags (-fPIC) ... ok
stack traceback:
[C]: in function 'error'
[@programdir\core\base\os.lua:949]:
[@programdir\core\sandbox\modules\os.lua:273]: in function 'runv'
[@programdir\modules\detect\tools\gcc\has_flags.lua:42]:
checking for flags (-TC:\Program Files\xmake\actions\config/misc/AT32F437xM_FLASH.ld) ... no
arm-none-eabi-g++ "-TC:\Program" "Files\xmake\actions\config/misc/AT32F437xM_FLASH.ld"
checkinfo: @programdir\core\sandbox\modules\os.lua:273: arm-none-eabi-g++: error: Files\xmake\actions\config/misc/AT32F437xM_FLASH.ld: No such file or directory
stack traceback:
[C]: in function 'error'
[@programdir\core\base\os.lua:949]:
[@programdir\core\sandbox\modules\os.lua:273]: in function 'runv'
[@programdir\modules\detect\tools\gcc\has_flags.lua:42]:
[ 95%]: linking.debug threadx_surf437.elf
D:\Programs\gcc-arm-none-eabi-10.3-2021.10\bin\arm-none-eabi-g++ -o build\cross\arm\debug\threadx_surf437.elf build.objs\threadx_surf437\cross\arm\debug\bsp\at32\surf_f437\src\at32f435_437_clock.c.o build.objs\threadx_surf437\cross\arm\debug\bsp\at32\surf_f437\src\at32f435_437_int.c.o build.objs\threadx_surf437\cross\arm\debug\bsp\at32\surf_f437\src\main.c.o build.objs\threadx_surf437\cross\arm\debug\bsp\at32\surf_f437\board\at_surf_f437_board_delay.c.o build.objs\threadx_surf437\cross\arm\debug\bsp\at32\surf_f437\board\at_surf_f437_board_lcd.c.o build.objs\threadx_surf437\cross\arm\debug\bsp\at32\surf_f437\board\at_surf_f437_board_font.c.o build.objs\threadx_surf437\cross\arm\debug\bsp\at32\surf_f437\board\at_surf_f437_board_rgbled.c.o -Lbuild\cross\arm\debug -lat32f435_437_fw -mthumb -mcpu=cortex-m4 --specs=nosys.specs -Wl,--gc-sections
text data bss dec hex filename
285996 1088 60 287144 461a8 build\cross\arm\debug\threadx_surf437.elf
[100%]: build ok, spent 1.125s
warning: add_ldflags(""-TC:\Program Files\xmake\actions\config/misc/AT32F437xM_FLASH.ld"") is ignored, please pass {force = true} or call set_policy("check.auto_ignore_flags", false) if you want to set it.
The text was updated successfully, but these errors were encountered:
Bot detected the issue body's language is not English, translate it automatically.
local ldscript = "-T".."$(scriptdir)/misc/AT32F437xM_FLASH.ld"
print(ldscript)
-- wrong
-- target:add("ldflags",ldscript, { force = true })
-- wrong
-- target:add("ldflags","-T$(scriptdir)/misc/AT32F437xM_FLASH.ld", { force = true })
Do not use $(scriptdir) in the script domain. It is mainly used for the description domain. Use os.scriptdir() in the script domain. Use the interface directly, otherwise the path will be incorrect.
Xmake 版本
2.8.6
操作系统版本和架构
Windows 11 23H2
描述问题
通过在on_load增加ldflags,代码如下:
执行的时候会忽略掉这个添加项,给的信息如下:
实际上我已经增加了force=true,但是没用,试了一下三种写法,只有最后一种是没问题的,但是这种写法并不理想。
期待的结果
由于target在根脚本
includes
的子脚本中,因此打算弄成自动获取目录的方式增加灵活性。描述域好像获取不了(试过scriptdir和curdir都是获取到根脚本的目录),在描述域force=true又好像这种写法不生效,还有其他办法吗?工程配置
根脚本:
子脚本:
附加信息和错误日志
checking for arm-none-eabi-gcc ... D:\Programs\gcc-arm-none-eabi-10.3-2021.10\bin\arm-none-eabi-gcc
checking for the c compiler (cc) ... arm-none-eabi-gcc
checking for the c compiler (cc) ... arm-none-eabi-gcc
checking for the c compiler (cc) ... arm-none-eabi-gcc
checking for the c compiler (cc) ... arm-none-eabi-gcc
checking for the c compiler (cc) ... arm-none-eabi-gcc
checking for the c compiler (cc) ... arm-none-eabi-gcc
checking for the c compiler (cc) ... arm-none-eabi-gcc
checking for the c compiler (cc) ... arm-none-eabi-gcc
checking for the c compiler (cc) ... arm-none-eabi-gcc
checking for the c compiler (cc) ... arm-none-eabi-gcc
checking for the c compiler (cc) ... arm-none-eabi-gcc
checking for the c compiler (cc) ... arm-none-eabi-gcc
checking for the c compiler (cc) ... arm-none-eabi-gcc
checking for the c compiler (cc) ... arm-none-eabi-gcc
checking for the c compiler (cc) ... arm-none-eabi-gcc
checking for the c compiler (cc) ... arm-none-eabi-gcc
checking for the c compiler (cc) ... arm-none-eabi-gcc
checking for the c compiler (cc) ... arm-none-eabi-gcc
checking for the c compiler (cc) ... arm-none-eabi-gcc
checking for the c compiler (cc) ... arm-none-eabi-gcc
checking for the c compiler (cc) ... arm-none-eabi-gcc
checking for the c compiler (cc) ... arm-none-eabi-gcc
checking for the c compiler (cc) ... arm-none-eabi-gcc
checking for the c compiler (cc) ... arm-none-eabi-gcc
checking for the c compiler (cc) ... arm-none-eabi-gcc
checking for the c compiler (cc) ... arm-none-eabi-gcc
checking for the c compiler (cc) ... arm-none-eabi-gcc
checking for the c compiler (cc) ... arm-none-eabi-gcc
checking for the c compiler (cc) ... arm-none-eabi-gcc
checking for the c compiler (cc) ... arm-none-eabi-gcc
checking for the c compiler (cc) ... arm-none-eabi-gcc
checking for the c compiler (cc) ... arm-none-eabi-gcc
checking for the c compiler (cc) ... arm-none-eabi-gcc
checking for the c compiler (cc) ... arm-none-eabi-gcc
checking for D:\Programs\gcc-arm-none-eabi-10.3-2021.10\bin\arm-none-eabi-gcc ... ok
checking for flags (-fPIC) ... ok
stack traceback:
[C]: in function 'error'
[@programdir\core\base\os.lua:949]:
[@programdir\core\sandbox\modules\os.lua:273]: in function 'runv'
[@programdir\modules\detect\tools\gcc\has_flags.lua:42]:
checking for flags (-TC:\Program Files\xmake\actions\config/misc/AT32F437xM_FLASH.ld) ... no
stack traceback:
[C]: in function 'error'
[@programdir\core\base\os.lua:949]:
[@programdir\core\sandbox\modules\os.lua:273]: in function 'runv'
[@programdir\modules\detect\tools\gcc\has_flags.lua:42]:
[ 95%]: linking.debug threadx_surf437.elf
D:\Programs\gcc-arm-none-eabi-10.3-2021.10\bin\arm-none-eabi-g++ -o build\cross\arm\debug\threadx_surf437.elf build.objs\threadx_surf437\cross\arm\debug\bsp\at32\surf_f437\src\at32f435_437_clock.c.o build.objs\threadx_surf437\cross\arm\debug\bsp\at32\surf_f437\src\at32f435_437_int.c.o build.objs\threadx_surf437\cross\arm\debug\bsp\at32\surf_f437\src\main.c.o build.objs\threadx_surf437\cross\arm\debug\bsp\at32\surf_f437\board\at_surf_f437_board_delay.c.o build.objs\threadx_surf437\cross\arm\debug\bsp\at32\surf_f437\board\at_surf_f437_board_lcd.c.o build.objs\threadx_surf437\cross\arm\debug\bsp\at32\surf_f437\board\at_surf_f437_board_font.c.o build.objs\threadx_surf437\cross\arm\debug\bsp\at32\surf_f437\board\at_surf_f437_board_rgbled.c.o -Lbuild\cross\arm\debug -lat32f435_437_fw -mthumb -mcpu=cortex-m4 --specs=nosys.specs -Wl,--gc-sections
text data bss dec hex filename
285996 1088 60 287144 461a8 build\cross\arm\debug\threadx_surf437.elf
build cache stats:
cache directory: build.build_cache
cache hit rate: 100%
cache hit: 36
cache miss: 0
new cached files: 0
remote cache hit: 0
remote new cached files: 0
preprocess failed: 0
compile fallback count: 0
[100%]: build ok, spent 1.125s
warning: add_ldflags(""-TC:\Program Files\xmake\actions\config/misc/AT32F437xM_FLASH.ld"") is ignored, please pass
{force = true}
or callset_policy("check.auto_ignore_flags", false)
if you want to set it.The text was updated successfully, but these errors were encountered: