我试图使用scon构建一个简单的hello world项目,显式地设置链接器标志以读取自定义链接器脚本:
env.Append(LINKFLAGS = [
'-T script/linker_script.ld'
])问题是,当运行此操作时,SCons在-T选项周围放置双引号“”,结果如下所示:
arm-none-eabi-ld -o bareMetalStartupScons.elf "-T script/linker_script.ld" src/main.o asm/startup.o
arm-none-eabi-ld: cannot open linker script file script/linker_script.ld: No such file or directory脚本就在那里,如果我只需删除双引号并手动运行命令,它就会完成,而不会出现错误。
arm-none-eabi-ld -T script/linker_script.ld src/main.o asm/startup.o对这个问题有什么解决办法,或者知道为什么会发生这种情况?
发布于 2017-02-10 15:38:04
实际上,我找到了一个解决这个问题的方法,就是指定链接器脚本的路径,而不需要从-T中获得任何空间。
env.Append(LINKFLAGS = [
'-Tscript/linker_script.ld'
])在这种情况下,SCons在将参数“作为字符串”传递给可执行文件时不会使用双引号。
https://stackoverflow.com/questions/42162518
复制相似问题