找回密码
 用户注册

QQ登录

只需一步,快速开始

查看: 5414|回复: 1

求救 aix上 ACE 问题

[复制链接]
发表于 2008-9-18 23:28:43 | 显示全部楼层 |阅读模式
原来在linux上测试的程序,打算移植到AIX 上测试。
$ g++ -v                 
Reading specs from /opt/freeware/lib/gcc-lib/powerpc-ibm-aix5.3.0.0/3.3.2/specs
Configured with: ../configure --with-as=/usr/bin/as --with-ld=/usr/bin/ld --disable-nls --enable-languages=c,c++ --prefix=/opt/freeware --enable-threads --enable-version-specific-runtime-libs --host=powerpc-ibm-aix5.3.0.0
Thread model: aix
gcc version 3.3.2
编译过程:
设置环境变量
  export ACE_ROOT=/home/aceuser/ACE_wrappers
  export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$ACE_ROOT/ace
  #cd  /home/aceuser/ACE_wrappers/ace/
  #cp  ./config-aix-5.x.h ./config.h
  #cd ../include/makeinclude/
  #ln -s ./platform_aix_g++.GNU ./platform_macros.GNU
  #cd /home/aceuser/ACE_wrappers/ace/
  #make
生成库时,编译ACE是通过了,但连接时出现下面的问题:
ld: 0711-224 WARNING: Duplicate symbol: _GLOBAL__F_thread_creds_t
ld: 0711-224 WARNING: Duplicate symbol: thread_creds_t
ld: 0711-224 WARNING: Duplicate symbol: fc_softc
ld: 0711-224 WARNING: Duplicate symbol: ._GLOBAL__I_thread_creds_t
ld: 0711-224 WARNING: Duplicate symbol: ._GLOBAL__D_thread_creds_t
ld: 0711-224 WARNING: Duplicate symbol: _GLOBAL__F_fc_softc
ld: 0711-224 WARNING: Duplicate symbol: _GLOBAL__I_thread_creds_t
ld: 0711-224 WARNING: Duplicate symbol: _GLOBAL__D_thread_creds_t
ld: 0711-345 Use the -bloadmap or -bnoquiet option to obtain more information.
ar cruv libACE.a.5.5.0 shr.o
a - shr.o
ranlib libACE.a.5.5.0
rm -f libACE.a
ln -s libACE.a.5.5.0 libACE.a
chmod a+rx libACE.a.5.5.0
Installing libACE.a -> ../lib
Installing libACE.a.5.5.0 -> ../lib
rm shr.o
。。。。。。。
库是生成了,写简单的程序也编译通过,但是运行就出问题了:
// ACE库
#include "ace/ACE.h"
#include "ace/OS_main.h"
#include "ace/Reactor.h"
#include "ace/Acceptor.h"
#include "ace/Connector.h"
#include "ace/Log_Msg.h"
#include "ace/Handle_Set.h"
#include "ace/SString.h"
#include "ace/Synch.h"
#include "ace/Task.h"
#include "ace/Log_Record.h"
#include "ace/Log_Msg_Callback.h"
#include "ace/OS_NS_string.h"
#include "ace/OS_NS_unistd.h"
#include "ace/OS_NS_sys_socket.h"
#include "ace/OS_NS_sys_time.h"
#include "ace/OS_NS_time.h"
#include "ace/OS_NS_signal.h"
#include "ace/OS_NS_ctype.h"
#include "ace/Get_Opt.h"
#include "ace/INET_Addr.h"
#include "ace/Service_Object.h"
#include "ace/Signal.h"
#include "ace/Svc_Handler.h"
#include "ace/SOCK_Acceptor.h"
#include "ace/SOCK_Connector.h"
#include "ace/SOCK_Stream.h"
#include "ace/Synch_Traits.h"
#include "ace/Message_Block.h"
#include "ace/Thread_Manager.h"
#include "ace/os_include/os_netdb.h"
#include "ace/Reactor_Notification_Strategy.h"
#include "ace/Time_Value.h"
#include "ace/Singleton.h"
#include "ace/Configuration.h"
#include "ace/Configuration_Import_Export.h"
#include "ace/Map_T.h"
#include "ace/Date_Time.h"
#include "ace/Guard_T.h"
#include "ace/SOCK_SEQPACK_Association.h"
#include <ace/OS.h>
#include <ace/OS_main.h>
#include <ace/TP_Reactor.h>
int ACE_TMAIN(int argc, ACE_TCHAR *argv[])
{
   ACE_DEBUG((LM_DEBUG, ACE_TEXT("ACE_TMAIN")));
        return 0;
}
g++ -g -o Test -L/home/accuser/ACE_wrappers/lib  Test.o -lACE
问题如下:
exec(): 0509-036 Cannot load program ./TestModule because of the following errors:
        0509-130 Symbol resolution failed for /opt/ACE_wrappers/ace/libACE.a(shr.o) because:
        0509-136   Symbol _GLOBAL__F__ZNSt12__basic_fileIcEC2EP15pthread_mutex_t (number 280) is not exported from
                   dependent module /opt/freeware/lib/gcc-lib/powerpc-ibm-aix5.3.0.0/3.3.2/libstdc++.a(libstdc++.so.5).
        0509-136   Symbol _GLOBAL__F__ZN10__cxxabiv161_GLOBAL__N_.._.._.._.._.._libstdc___v3_libsupc___vec.ccxvlXRA17uncatch_exceptionC2Ev (number 294) is not exported from
                   dependent module /opt/freeware/lib/gcc-lib/powerpc-ibm-aix5.3.0.0/3.3.2/libstdc++.a(libstdc++.so.5).
        0509-136   Symbol _ZNSt12__basic_fileIcEC1EP15pthread_mutex_t (number 441) is not exported from
                   dependent module /opt/freeware/lib/gcc-lib/powerpc-ibm-aix5.3.0.0/3.3.2/libstdc++.a(libstdc++.so.5).
        0509-026 System error: Error 0
        0509-192 Examine .loader section symbols with the
                 'dump -Tv' command.
请大家帮忙看看。
 楼主| 发表于 2008-9-18 23:28:51 | 显示全部楼层
找了一下,不知道能否解决你的问题:

>>>>> Markus Schaeffer@ceay org writes:

>> [aix3]$ ./superman
>> exec(): 0509-036 Cannot load program ./superman because of the
>> following errors:
>>         0509-130 Symbol resolution failed for ./lib/libxerces-c1_6_0.a
>> because:
>>         0509-136   Symbol
>> _GLOBAL__F__ZNSt12__basic_fileIcEC2EP15pthread_mutex_t (number 151) is
>> not exported from
>>                    dependent module
>> /pkg/tools/compiler/gcc/lib/libstdc++.a(libstdc++.so.5).

> It sounds like you are using different libstdc++.a at link time
> and at runtime.

This definitely is a problem of linking against a different shared
library multilib than the one used at runtime.

The libxerces-c1_6_0.a library appears to have been built and
linked with -pthread option, but superman may not have been built that
way.  -pthread uses .../lib/pthread/libstdc++.a, for wherever GCC was
installed.  .../lib/pthread/libstdc++.a has pthread_mutex_t symbols,
.../lib/libstdc++.a does not.

AIX does not have weak bindings of pthread functions for
non-pthread applications.  One has to use -pthread consistently.

Either superman was compiled and linked differently, so the
built-in runtime LIBPATH is wrong, or the LIBPATH environment variable
explicitly is set and overriding the application LIBPATH to point to the
default shared library installation directory instead of the one
appropriate for the application.

David
您需要登录后才可以回帖 登录 | 用户注册

本版积分规则

Archiver|手机版|小黑屋|ACE Developer ( 京ICP备06055248号 )

GMT+8, 2024-4-30 08:33 , Processed in 0.015736 second(s), 6 queries , Redis On.

Powered by Discuz! X3.5

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表