【问题标题】:static linking on AIX with pthread在 AIX 上使用 pthread 进行静态链接
【发布时间】:2010-09-26 17:58:13
【问题描述】:

我已经阅读和研究了这几天 现在,并决定我需要一些外部帮助!

(而且这个网站看起来是个不错的地方,所以我想我会 在这里发布我的问题,看看情况如何)

我们的小公司还没有在 AIX 上构建我们的应用程序 几年来,我被分配了这个任务(好 我喜欢挑战的事情)。

我遇到的问题很容易描述,我可以看到 其他人也在经历它,虽然我看不到 找到答案。

如果我链接应用程序“非静态”,这意味着我不使用“-static” 在构建命令中,应用程序在开发中运行良好 机器,但不在我们用于的其他 AIX 机器上 测试。

【两机速记;

开发者:

~$ uname -a
AIX aix3 2 5 000BA50D4C00

测试:

~$ uname -a
AIX aix4 1 5 002459A64C00

]

如果我使用“-static”链接,应用程序会在运行时“中断” 抛出异常时在开发机器上:

terminate called after throwing an instance of 'MyAppError'
Segmentation fault      (core dumped)

并且(好像这还不够),应用仍然没有 在测试机上运行:

exec(): 0509-036 Cannot load program ./myapp because of the following errors:
        0509-130 Symbol resolution failed for myapp because:
        0509-136   Symbol _sigqueue (number 65) is not exported from
                   dependent module /unix.
        0509-136   Symbol ra_attachrset (number 95) is not exported from
                   dependent module /unix.
        0509-136   Symbol __rs_pickmcm (number 99) is not exported from
                   dependent module /unix.
        0509-136   Symbol _timer_create (number 122) is not exported from
                   dependent module /unix.
        0509-136   Symbol _timer_delete (number 123) is not exported from
                   dependent module /unix.
        0509-136   Symbol _timer_getoverrun (number 124) is not exported from
                   dependent module /unix.
        0509-136   Symbol _timer_gettime (number 125) is not exported from
                   dependent module /unix.
        0509-136   Symbol _timer_settime (number 126) is not exported from
                   dependent module /unix.
        0509-136   Symbol count_event_waiters (number 159) is not exported from
                   dependent module /unix.
        0509-192 Examine .loader section symbols with the
                 'dump -Tv' command.

我应该在这里指出,我们正在使用“-pthead”链接, 我读过几篇说这不行的文章 使用 pthread 时静态链接。

我的脑袋疼。

如果您对此提出任何意见,我将不胜感激。

【问题讨论】:

    标签: c++ linker pthreads static-libraries aix


    【解决方案1】:

    您的部分问题是您在 AIX 5.2 上构建并尝试在 AIX 5.1 上进行测试(uname -a 信息表明 - 感谢您提供它)。您通常可以在较旧的平台上构建并在较新的平台上运行,但反之则不行。所以,这就是你麻烦的开始。

    AIX 5.1 和 5.2 都很长;您应该至少使用 AIX 5.3,并且可以说是 AIX 6.x。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2015-06-21
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-04-05
      • 2012-05-02
      • 2010-10-25
      相关资源
      最近更新 更多