我有学习makefile项目。我使用的GNU GCC和作为连接器,我用下面的参数在gcc:链接器语法:链接器不会在链接过程中使用所有链接器的标记
linkerCmdLine=$(exe) -Wl,--start-group -nostdlib -Map=test_mapfile.map -l:libc.a -l:libgcc.a -l:libm.a -Wl,--end-group -o $(output)
在关联过程中,连接器不使用所有这些标志: 不使用标志-Map=test_mapfile.map
。
为什么?
有一个项目设置文件,在这个文件中还存储了链接器设置。
\u201ClinkerCmdLine\=$(exe) -Wl, --start-group -nostdlib -Map\=./99_output/PUZ_GPF.map --gc-sections -l\:libc.a -l\:libgcc.a -l\:libm.a -Wl,--end-group -o $(output)\u201D
如何存储设置是否正确?
编辑:
随着地图文件工作正常,但我有一个链接文件实际上问题。我只用以下标志:
“linkerCmdLine = $(EXE)轮候册,--script = C:/workspace/test_project/test_linker_file.ld -static -o $(输出)”
我得到此错误在控制台窗口:
臂-NONE-EABI-gcc.exe:错误:无法识别的命令行选项 '--script = C:/workspace/test_project/test_linker_file.ld'
我不不明白为什么,因为映射文件和.ld文件属于链接器标记。