【发布时间】:2010-10-10 23:09:23
【问题描述】:
我在花店库中再次编译申请人时遇到问题。原来我对花店有一个更大的问题(最新的 2010 Adacore GPL 下载和 Debian 存档中的 2009 版本都产生了相同的错误)。 Florist 有一些低级问题,但是当我查看生成的文件时,它似乎正确地包含了 errno.h。
当我建立花店时会发生以下情况:
gcc-4.4 -c -I/usr/share/ada/adainclude/florist demo.adb gcc-4.4 -c -I./ -I/usr/share/ada/adainclude/florist -I- /usr/share/ada/adainclude/florist/posix.adb gcc-4.4 -c -I./ -I/usr/share/ada/adainclude/florist -I- /usr/share/ada/adainclude/florist/posix-io.adb gcc-4.4 -c -I./ -I/usr/share/ada/adainclude/florist -I- /usr/share/ada/adainclude/florist/posix-terminal_functions.adb gcc-4.4 -c -I./ -I/usr/share/ada/adainclude/florist -I- /usr/share/ada/adainclude/florist/posix-c.adb gcc-4.4 -c -I./ -I/usr/share/ada/adainclude/florist -I- /usr/share/ada/adainclude/florist/posix-implementation.adb posix-implementation.gpb:45:06:警告:“SYSTEM.INTERRUPT_MANAGEMENT.OPERATIONS”是一个内部 GNAT 单元 posix-implementation.gpb:45:06: 警告:使用这个单元是不可移植的和版本相关的 posix-implementation.gpb:47:06:警告:“SYSTEM.SOFT_LINKS”是一个内部 GNAT 单元 posix-implementation.gpb:47:06: 警告:使用这个单元是不可移植的并且依赖于版本 gcc-4.4 -c -I./ -I/usr/share/ada/adainclude/florist -I- /usr/share/ada/adainclude/florist/ada_streams.ads gcc-4.4 -c -I./ -I/usr/share/ada/adainclude/florist -I- /usr/share/ada/adainclude/florist/posix-permissions.adb gcc-4.4 -c -I./ -I/usr/share/ada/adainclude/florist -I- /usr/share/ada/adainclude/florist/posix-permissions-implementation.adb gcc-4.4 -c -I./ -I/usr/share/ada/adainclude/florist -I- /usr/share/ada/adainclude/florist/posix-process_identification.adb gnatbind -I/usr/share/ada/adainclude/florist -x demo.ali gnatlink demo.ali -o demoapp ./posix-implementation.o:在函数“posix__implementation__set_ada_error_code”中: posix-implementation.adb:(.text+0x19e): undefined reference to `store_errno' ./posix-implementation.o:在函数“posix__implementation__get_ada_error_code”中: posix-implementation.adb:(.text+0x1ab): undefined reference to `fetch_errno' ./posix-implementation.o:在函数“posix__implementation__raise_posix_error”中: posix-implementation.adb:(.text+0x234): undefined reference to `fetch_errno' ./posix-implementation.o:在函数`posix__implementation__check__2'中: posix-implementation.adb:(.text+0x2e5): undefined reference to `fetch_errno' ./posix-implementation.o:在函数`posix__implementation__check__3'中: posix-implementation.adb:(.text+0x313): undefined reference to `fetch_errno' ./posix-implementation.o:在函数“posix__implementation__check_nneg”中: posix-implementation.adb:(.text+0x332): undefined reference to `fetch_errno' ./posix-implementation.o:posix-implementation.adb:(.text+0x34e): 更多未定义的对 `fetch_errno' 的引用如下 ./posix-implementation.o:在函数“nosys_neg_one”中: posix-implementation.adb:(.text+0xaef): undefined reference to `store_errno' ./posix-implementation.o:在函数“notsup_neg_one”中: posix-implementation.adb:(.text+0xb15): undefined reference to `store_errno' ./posix-implementation.o:在函数“posix__implementation__restore_signals_and_raise_posix_error”中: posix-implementation.adb:(.text+0xc88): undefined reference to `fetch_errno' ./posix.o:在函数“posix__system_name”中: posix.adb:(.text+0x2f98): undefined reference to `__gnat_florist_uname' ./posix.o:在函数“posix__node_name”中: posix.adb:(.text+0x2fef): 对 `__gnat_florist_uname' 的未定义引用 ./posix.o:在函数“posix__release”中: posix.adb:(.text+0x3049): undefined reference to `__gnat_florist_uname' ./posix.o:在函数“posix__version”中: posix.adb:(.text+0x30a6): undefined reference to `__gnat_florist_uname' ./posix.o:在函数“posix__machine”中: posix.adb:(.text+0x3103): undefined reference to `__gnat_florist_uname' ./posix.o:在函数“posix__host_to_network_byte_order”中: posix.adb:(.text+0x4627): undefined reference to `c_htonl' ./posix.o:在函数“posix__host_to_network_byte_order__2”中: posix.adb:(.text+0x4642): undefined reference to `c_htons' ./posix.o:在函数“posix__network_to_host_byte_order”中: posix.adb:(.text+0x4655): undefined reference to `c_ntohl' ./posix.o:在函数“posix__network_to_host_byte_order__2”中: posix.adb:(.text+0x4670): undefined reference to `c_ntohs' ./posix-io.o:在函数“posix__io__open”中: posix-io.adb:(.text+0x4d1): undefined reference to `__gnat_florist_open' ./posix-io.o:在函数“posix__io__open_or_create”中: posix-io.adb:(.text+0xfca): undefined reference to `__gnat_florist_open' collect2: ld 返回 1 个退出状态 gnatlink:调用 /usr/bin/gcc-4.4 时出错 gnatmake:***链接失败。 josh@Mini10:~/Demo$ gnatbind -I/usr/share/ada/adainclude/florist -I/usr/include 演示 josh@Mini10:~/Demo$ gnatlink 演示 ./posix-implementation.o:在函数“posix__implementation__set_ada_error_code”中: posix-implementation.adb:(.text+0x19e): undefined reference to `store_errno' ./posix-implementation.o:在函数“posix__implementation__get_ada_error_code”中: posix-implementation.adb:(.text+0x1ab): undefined reference to `fetch_errno' ./posix-implementation.o:在函数“posix__implementation__raise_posix_error”中: posix-implementation.adb:(.text+0x234): undefined reference to `fetch_errno' ./posix-implementation.o:在函数`posix__implementation__check__2'中: posix-implementation.adb:(.text+0x2e5): undefined reference to `fetch_errno' ./posix-implementation.o:在函数`posix__implementation__check__3'中: posix-implementation.adb:(.text+0x313): undefined reference to `fetch_errno' ./posix-implementation.o:在函数“posix__implementation__check_nneg”中: posix-implementation.adb:(.text+0x332): undefined reference to `fetch_errno' ./posix-implementation.o:posix-implementation.adb:(.text+0x34e): 更多未定义的对 `fetch_errno' 的引用如下 ./posix-implementation.o:在函数“nosys_neg_one”中: posix-implementation.adb:(.text+0xaef): undefined reference to `store_errno' ./posix-implementation.o:在函数“notsup_neg_one”中: posix-implementation.adb:(.text+0xb15): undefined reference to `store_errno' ./posix-implementation.o:在函数“posix__implementation__restore_signals_and_raise_posix_error”中: posix-implementation.adb:(.text+0xc88): undefined reference to `fetch_errno' ./posix.o:在函数“posix__system_name”中: posix.adb:(.text+0x2f98): undefined reference to `__gnat_florist_uname' ./posix.o:在函数“posix__node_name”中: posix.adb:(.text+0x2fef): 对 `__gnat_florist_uname' 的未定义引用 ./posix.o:在函数“posix__release”中: posix.adb:(.text+0x3049): undefined reference to `__gnat_florist_uname' ./posix.o:在函数“posix__version”中: posix.adb:(.text+0x30a6): undefined reference to `__gnat_florist_uname' ./posix.o:在函数“posix__machine”中: posix.adb:(.text+0x3103): undefined reference to `__gnat_florist_uname' ./posix.o:在函数“posix__host_to_network_byte_order”中: posix.adb:(.text+0x4627): undefined reference to `c_htonl' ./posix.o:在函数“posix__host_to_network_byte_order__2”中: posix.adb:(.text+0x4642): undefined reference to `c_htons' ./posix.o:在函数“posix__network_to_host_byte_order”中: posix.adb:(.text+0x4655): undefined reference to `c_ntohl' ./posix.o:在函数“posix__network_to_host_byte_order__2”中: posix.adb:(.text+0x4670): undefined reference to `c_ntohs' ./posix-io.o:在函数“posix__io__open”中: posix-io.adb:(.text+0x4d1): undefined reference to `__gnat_florist_open' ./posix-io.o:在函数“posix__io__open_or_create”中: posix-io.adb:(.text+0xfca): undefined reference to `__gnat_florist_open' collect2: ld 返回 1 个退出状态 gnatlink:调用 /usr/bin/gcc-4.4 时出错
如果正确包含 errno.h 存在问题,则此错误似乎很常见。但据我从 posix-c.c 文件中可以看出,这一切看起来都是正确的。有人对如何解决这个问题有任何建议吗? Florist 的 make 文件构建正确,所以我不知道这是从哪里来的。
【问题讨论】:
-
重新标记为 gnat,因为这个问题完全是 gnat-specific。