Tilera 交叉编译 - 链接错误

发布于 2024-10-03 06:24:08 字数 1530 浏览 0 评论 0原文

我正在尝试交叉编译 Tilera 的源代码,但在链接时出现以下错误。 所有这些错误都与C++ STL(标准模板库)有关。

STL库的链接过程有什么区别吗?

错误是:

gtpu_t. a: In function `stlp_std::_Atomic_swap_struct<0>::_S_swap(unsigned int volatile* , unsigned int)':
91 /u/TILERA/TileraMDE-2.1.1.107611/tilepro/tile/usr/include/cpp/stl/stl/_threads.h :588: undefined reference to `stlp_std::_Atomic_swap_struct<0>::_S_swap_lock'
92 /u/TILERA/TileraMDE-2.1.1.107611/tilepro/tile/usr/include/cpp/stl/stl/_threads.h :588: undefined reference to `stlp_std::_Atomic_swap_struct<0>::_S_swap_lock'
93 /u/TILERA/TileraMDE-2.1.1.107611/tilepro/tile/usr/include/cpp/stl/stl/_threads.h :591: undefined reference to `stlp_std::_Atomic_swap_struct<0>::_S_swap_lock'
94 /u/TILERA/TileraMDE-2.1.1.107611/tilepro/tile/usr/include/cpp/stl/stl/_threads.h :591: undefined reference to `stlp_std::_Atomic_swap_struct<0>::_S_swap_lock'
95 /u/TILERA/LTESTACK/TILERA/DEV/lte/lte_enb/enb_app/../enb_gtpu/gtpu_t/lib/gtpu_t. a: In function `stlp_std::_Atomic_swap_struct<0>::_S_swap_ptr(void* volatile*, v oid*)':
96 /u/TILERA/TileraMDE-2.1.1.107611/tilepro/tile/usr/include/cpp/stl/stl/_threads.h :614: undefined reference to `stlp_std::_Atomic_swap_struct<0>::_S_swap_lock'
97 /u/TILERA/LTESTACK/TILERA/DEV/lte/lte_enb/enb_app/../enb_gtpu/gtpu_t/lib/gtpu_t. a:/u/TILERA/TileraMDE-2.1.1.107611/tilepro/tile/usr/include/cpp/stl/stl/_threads .h:614: more undefined references to `stlp_std::_Atomic_swap_struct<0>::_S_swap_ lock' follow 

I'm trying to cross compile a source for Tilera and I got the following error while linking.
All these errors are related to C++ STL(Standard Template Library).

Is there any difference in linking process of a STL library?

Errors are:

gtpu_t. a: In function `stlp_std::_Atomic_swap_struct<0>::_S_swap(unsigned int volatile* , unsigned int)':
91 /u/TILERA/TileraMDE-2.1.1.107611/tilepro/tile/usr/include/cpp/stl/stl/_threads.h :588: undefined reference to `stlp_std::_Atomic_swap_struct<0>::_S_swap_lock'
92 /u/TILERA/TileraMDE-2.1.1.107611/tilepro/tile/usr/include/cpp/stl/stl/_threads.h :588: undefined reference to `stlp_std::_Atomic_swap_struct<0>::_S_swap_lock'
93 /u/TILERA/TileraMDE-2.1.1.107611/tilepro/tile/usr/include/cpp/stl/stl/_threads.h :591: undefined reference to `stlp_std::_Atomic_swap_struct<0>::_S_swap_lock'
94 /u/TILERA/TileraMDE-2.1.1.107611/tilepro/tile/usr/include/cpp/stl/stl/_threads.h :591: undefined reference to `stlp_std::_Atomic_swap_struct<0>::_S_swap_lock'
95 /u/TILERA/LTESTACK/TILERA/DEV/lte/lte_enb/enb_app/../enb_gtpu/gtpu_t/lib/gtpu_t. a: In function `stlp_std::_Atomic_swap_struct<0>::_S_swap_ptr(void* volatile*, v oid*)':
96 /u/TILERA/TileraMDE-2.1.1.107611/tilepro/tile/usr/include/cpp/stl/stl/_threads.h :614: undefined reference to `stlp_std::_Atomic_swap_struct<0>::_S_swap_lock'
97 /u/TILERA/LTESTACK/TILERA/DEV/lte/lte_enb/enb_app/../enb_gtpu/gtpu_t/lib/gtpu_t. a:/u/TILERA/TileraMDE-2.1.1.107611/tilepro/tile/usr/include/cpp/stl/stl/_threads .h:614: more undefined references to `stlp_std::_Atomic_swap_struct<0>::_S_swap_ lock' follow 

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

孤城病女 2024-10-10 06:24:08

我认为这会有所帮助。我之前尝试用 Tilera 进行编译并得到类似的错误,“未定义的引用”。解决方案是将库包含在项目属性中。

单击项目设置,转到“路径和符号”,然后在库下包含定义了 stlp_std::_Atomic_swap_struct<0>::_S_swap_lock 的库。

另请注意,Tilera IDE (eclipse) 是愚蠢的。定义 Tile 库的路径将不起作用!只需输入图书馆的名称即可。 (假设您正确设置了 IDE 变量)。如果您使用命令行,只需添加参数即可包含该库
-lMyLibrary

这是一个示例:
在库下有:

tmc
pthread

我假设你正在Linux下开发

I think this will help. I tried compiling with Tilera before and got similar errors, "undefined reference to". The solution was to include the library in the project properties.

Click on your project settings, go to Paths and Symbols, and under libraries include the library the stlp_std::_Atomic_swap_struct<0>::_S_swap_lock is defined in.

Also note that Tilera IDE (eclipse) is dumb. Defining the path to your Tile library will not work! Just type in the name of the library. (Given the fact that you set up your IDE variables correctly). If you are using command lines, include the library by simply adding the argument
-lMyLibrary

Here is an example:
Under libraries there is:

tmc
pthread

I assume you are developing under Linux

夜深人未静 2024-10-10 06:24:08

“STL”只是 C++ 实现的一部分。它不应该被专门链接,就像您不需要专门链接 mallocnew 一样。

The "STL" is just part of your C++ implementation. It shouldn't be linked specifically, just like you don't need to link malloc or new specifically.

一世旳自豪 2024-10-10 06:24:08

如果我编译一个使用 _S_swap_lock 的小程序,它对我有用:

$ cat foo.cc
#include <rope>
int main(void)
{
  std::crope r(100000, 'x');
  std::crope r2 = r + "abc";
}
$ tile-c++ foo.cc
$ nm -C a.out | grep -i atomic
0000000000059028 V stlp_std::_Atomic_swap_struct<1>::_S_swap_lock

这是“<1>” flavor,用于 32 位原子,这似乎很常用。我没有看到 <0> libsupc++.a 中的风味。我怀疑您需要发布一些重现问题的代码。

If I compile a small program that uses , which uses _S_swap_lock, it works for me:

$ cat foo.cc
#include <rope>
int main(void)
{
  std::crope r(100000, 'x');
  std::crope r2 = r + "abc";
}
$ tile-c++ foo.cc
$ nm -C a.out | grep -i atomic
0000000000059028 V stlp_std::_Atomic_swap_struct<1>::_S_swap_lock

This is the "<1>" flavor, for 32-bit atomics, which seems to be commonly used. I don't see the <0> flavor in libsupc++.a. I suspect you'll need to post some code that reproduces the problem.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文