我正在构建自己的Ada运行时系统。
然而,只有当它被命名为“gnat”并编译为“libgnat.a”时,才能再次链接自定义运行时。如果我使用其他名称,则会出现ld错误:
/home/mark/opt/GNAT/2021/bin/../libexec/gcc/x86_64-pc-linux-gnu/10.3.1/ld: cannot find -lgnat
您有什么想法来配置它,使我可以使用不同的名称?
这是运行时的项目文件(其中大部分来自OSdev)。
project milo is
for Languages use ("Ada");
for Runtime ("Ada") use Project'Project_Dir;
for Library_Auto_Init use "False";
for Library_Name use "milo"; -- that must be "gnat"
for Library_Kind use "static";
for Library_Dir use "lib";
for Object_Dir use "obj";
for Source_Dirs use ("src/zfp", "src/milo");
package Builder is
for Global_Configuration_Pragmas use "milo.adc";
for Switches ("Ada") use (
"-nostdlib",
"-nostdinc"
);
end Builder;
package Compiler is
for Default_Switches ("Ada") use (
"-O2",
"-ffunction-sections",
"-fdata-sections",
"-fcallgraph-info=su,da",
"-gnatp",
"-gnatn2",
"-gnat2012",
"-gnatg",
"-Wl,--gc-sections",
"-gnatyN"
);
end Compiler;
end milo;
以下是我试图使用这个运行时的项目
project Helloworld is
for Source_Dirs use ("src");
for Object_Dir use "obj";
for Main use ("helloworld.adb");
for Runtime ("ada") use "/home/mark/Milo/milo/";
end Helloworld;