"relocation illegal when not bound to object being created" 是什么意思?

What does "relocation illegal when not bound to object being created" mean?

我正在尝试在 SPARC 运行 Solaris 10 上构建 Apache Qpid。现在 libqpidtypes.so 构建了,但是 libqpidcommon.so 没有 link。

编译后,linker 会生成很多这样的错误消息:

ld: fatal: relocation error: R_SPARC_TLS_LDO_ADD: file CMakeFiles/qpidcommon.dir/qpid/sys/posix/PosixPoller.cpp.o: symbol _ZZN4qpid3sys15DeletionManagerINS0_19PollerHandlePrivateEE15getThreadStatusEvE12threadStatus: bound to: CMakeFiles/qpidcommon.dir/qpid/sys/posix/PosixPoller.cpp.o: relocation illegal when not bound to object being created

我已经像这样构建了所需的提升库 program_options:

 ./b2 install address-model=64 cxxflags="-fPIC" --with-program_options

Google 产生 two unhelpful search results 到 "relocation illegal when not bound to object being created"

问题:你能给我提示错误消息告诉我什么吗?


编辑:

如果我注释掉线程本地存储说明符,Qpid 编译并 links 成功。当然,这在运行时是不正确的行为。

static ThreadStatus*& getThreadStatus() {

        //    THIS IS COMMENTED OUT
        static /*__thread*/ ThreadStatus* threadStatus = 0;

        // Thread local vars can't be dynamically constructed so we need
        // to check whether we've made it yet and construct it if not
        // (no locking necessary for the check as it's thread local!)
        if (!threadStatus) {
            threadStatus = new ThreadStatus;
            allThreadsStatuses.addThreadStatus(threadStatus);
        }

        return threadStatus;
    }

完整的错误信息如下:

ld: warning: file /usr/local/lib/libboost_program_options.so: attempted multiple inclusion of file ld: fatal: relocation error: R_SPARC_TLS_LDM_HI22: file CMakeFiles/qpidcommon.dir/qpid/sys/posix/PosixPoller.cpp.o: symbol _ZZN4qpid3sys15DeletionManagerINS0_19PollerHandlePrivateEE15getThreadStatusEvE12threadStatus: bound to: CMakeFiles/qpidcommon.dir/qpid/sys/posix/PosixPoller.cpp.o: relocation illegal when not bound to object being created ld: fatal: relocation error: R_SPARC_TLS_LDM_HI22: file CMakeFiles/qpidcommon.dir/qpid/sys/posix/PosixPoller.cpp.o: symbol _ZZN4qpid3sys15DeletionManagerINS0_19PollerHandlePrivateEE15getThreadStatusEvE12threadStatus: bound to: CMakeFiles/qpidcommon.dir/qpid/sys/posix/PosixPoller.cpp.o: relocation illegal when not bound to object being created ld: fatal: relocation error: R_SPARC_TLS_LDO_HIX22: file CMakeFiles/qpidcommon.dir/qpid/sys/posix/PosixPoller.cpp.o: symbol _ZZN4qpid3sys15DeletionManagerINS0_19PollerHandlePrivateEE15getThreadStatusEvE12threadStatus: bound to: CMakeFiles/qpidcommon.dir/qpid/sys/posix/PosixPoller.cpp.o: relocation illegal when not bound to object being created ld: fatal: relocation error: R_SPARC_TLS_LDM_LO10: file CMakeFiles/qpidcommon.dir/qpid/sys/posix/PosixPoller.cpp.o: symbol _ZZN4qpid3sys15DeletionManagerINS0_19PollerHandlePrivateEE15getThreadStatusEvE12threadStatus: bound to: CMakeFiles/qpidcommon.dir/qpid/sys/posix/PosixPoller.cpp.o: relocation illegal when not bound to object being created ld: fatal: relocation error: R_SPARC_TLS_LDM_ADD: file CMakeFiles/qpidcommon.dir/qpid/sys/posix/PosixPoller.cpp.o: symbol _ZZN4qpid3sys15DeletionManagerINS0_19PollerHandlePrivateEE15getThreadStatusEvE12threadStatus: bound to: CMakeFiles/qpidcommon.dir/qpid/sys/posix/PosixPoller.cpp.o: relocation illegal when not bound to object being created ld: fatal: relocation error: R_SPARC_TLS_LDM_CALL: file CMakeFiles/qpidcommon.dir/qpid/sys/posix/PosixPoller.cpp.o: symbol _ZZN4qpid3sys15DeletionManagerINS0_19PollerHandlePrivateEE15getThreadStatusEvE12threadStatus: bound to: CMakeFiles/qpidcommon.dir/qpid/sys/posix/PosixPoller.cpp.o: relocation illegal when not bound to object being created ld: fatal: relocation error: R_SPARC_TLS_LDO_LOX10: file CMakeFiles/qpidcommon.dir/qpid/sys/posix/PosixPoller.cpp.o: symbol _ZZN4qpid3sys15DeletionManagerINS0_19PollerHandlePrivateEE15getThreadStatusEvE12threadStatus: bound to: CMakeFiles/qpidcommon.dir/qpid/sys/posix/PosixPoller.cpp.o: relocation illegal when not bound to object being created ld: fatal: relocation error: R_SPARC_TLS_LDO_ADD: file CMakeFiles/qpidcommon.dir/qpid/sys/posix/PosixPoller.cpp.o: symbol _ZZN4qpid3sys15DeletionManagerINS0_19PollerHandlePrivateEE15getThreadStatusEvE12threadStatus: bound to: CMakeFiles/qpidcommon.dir/qpid/sys/posix/PosixPoller.cpp.o: relocation illegal when not bound to object being created ld: fatal: relocation error: R_SPARC_TLS_LDM_LO10: file CMakeFiles/qpidcommon.dir/qpid/sys/posix/PosixPoller.cpp.o: symbol _ZZN4qpid3sys15DeletionManagerINS0_19PollerHandlePrivateEE15getThreadStatusEvE12threadStatus: bound to: CMakeFiles/qpidcommon.dir/qpid/sys/posix/PosixPoller.cpp.o: relocation illegal when not bound to object being created ld: fatal: relocation error: R_SPARC_TLS_LDM_ADD: file CMakeFiles/qpidcommon.dir/qpid/sys/posix/PosixPoller.cpp.o: symbol _ZZN4qpid3sys15DeletionManagerINS0_19PollerHandlePrivateEE15getThreadStatusEvE12threadStatus: bound to: CMakeFiles/qpidcommon.dir/qpid/sys/posix/PosixPoller.cpp.o: relocation illegal when not bound to object being created ld: fatal: relocation error: R_SPARC_TLS_LDM_CALL: file CMakeFiles/qpidcommon.dir/qpid/sys/posix/PosixPoller.cpp.o: symbol _ZZN4qpid3sys15DeletionManagerINS0_19PollerHandlePrivateEE15getThreadStatusEvE12threadStatus: bound to: CMakeFiles/qpidcommon.dir/qpid/sys/posix/PosixPoller.cpp.o: relocation illegal when not bound to object being created ld: fatal: relocation error: R_SPARC_TLS_LDO_LOX10: file CMakeFiles/qpidcommon.dir/qpid/sys/posix/PosixPoller.cpp.o: symbol _ZZN4qpid3sys15DeletionManagerINS0_19PollerHandlePrivateEE15getThreadStatusEvE12threadStatus: bound to: CMakeFiles/qpidcommon.dir/qpid/sys/posix/PosixPoller.cpp.o: relocation illegal when not bound to object being created ld: fatal: relocation error: R_SPARC_TLS_LDO_ADD: file CMakeFiles/qpidcommon.dir/qpid/sys/posix/PosixPoller.cpp.o: symbol _ZZN4qpid3sys15DeletionManagerINS0_19PollerHandlePrivateEE15getThreadStatusEvE12threadStatus: bound to: CMakeFiles/qpidcommon.dir/qpid/sys/posix/PosixPoller.cpp.o: relocation illegal when not bound to object being created ld: fatal: relocation error: R_SPARC_TLS_LDM_LO10: file CMakeFiles/qpidcommon.dir/qpid/sys/posix/PosixPoller.cpp.o: symbol _ZZN4qpid3sys15DeletionManagerINS0_19PollerHandlePrivateEE15getThreadStatusEvE12threadStatus: bound to: CMakeFiles/qpidcommon.dir/qpid/sys/posix/PosixPoller.cpp.o: relocation illegal when not bound to object being created ld: fatal: relocation error: R_SPARC_TLS_LDM_ADD: file CMakeFiles/qpidcommon.dir/qpid/sys/posix/PosixPoller.cpp.o: symbol _ZZN4qpid3sys15DeletionManagerINS0_19PollerHandlePrivateEE15getThreadStatusEvE12threadStatus: bound to: CMakeFiles/qpidcommon.dir/qpid/sys/posix/PosixPoller.cpp.o: relocation illegal when not bound to object being created ld: fatal: relocation error: R_SPARC_TLS_LDM_CALL: file CMakeFiles/qpidcommon.dir/qpid/sys/posix/PosixPoller.cpp.o: symbol _ZZN4qpid3sys15DeletionManagerINS0_19PollerHandlePrivateEE15getThreadStatusEvE12threadStatus: bound to: CMakeFiles/qpidcommon.dir/qpid/sys/posix/PosixPoller.cpp.o: relocation illegal when not bound to object being created ld: fatal: relocation error: R_SPARC_TLS_LDO_LOX10: file CMakeFiles/qpidcommon.dir/qpid/sys/posix/PosixPoller.cpp.o: symbol _ZZN4qpid3sys15DeletionManagerINS0_19PollerHandlePrivateEE15getThreadStatusEvE12threadStatus: bound to: CMakeFiles/qpidcommon.dir/qpid/sys/posix/PosixPoller.cpp.o: relocation illegal when not bound to object being created ld: fatal: relocation error: R_SPARC_TLS_LDO_ADD: file CMakeFiles/qpidcommon.dir/qpid/sys/posix/PosixPoller.cpp.o: symbol _ZZN4qpid3sys15DeletionManagerINS0_19PollerHandlePrivateEE15getThreadStatusEvE12threadStatus: bound to: CMakeFiles/qpidcommon.dir/qpid/sys/posix/PosixPoller.cpp.o: relocation illegal when not bound to object being created * * * Error code 1 The following command caused the error: cd /export/home/user/qpid-cpp-0.34/build/src && /opt/csw/bin/cmake -E cmake_link_script CMakeFiles/qpidcommon.dir/link.txt --verbose= make: Fatal error: Command failed for target src/libqpidcommon.so.2.0.0' Current working directory /export/home/user/qpid-cpp-0.34/build * * * Error code 1 The following command caused the error: make -f src/CMakeFiles/qpidcommon.dir/build.make src/CMakeFiles/qpidcommon.dir/build make: Fatal error: Command failed for targetsrc/CMakeFiles/qpidcommon.dir/all' Current working directory /export/home/user/qpid-cpp-0.34/build * * * Error code 1 The following command caused the error: make -f CMakeFiles/Makefile2 all make: Fatal error: Command failed for target `all'


编辑:这里是 linker 命令

/usr/ccs/bin/ld -V -G -dy -z text -M /opt/csw/lib/gcc/sparc-sun-solaris2.10/4.9.2/../../../libgcc-unwind.map -Y P,/lib/sparcv9:/usr/lib/sparcv9 -Qy -o libqpidcommon.so.2.0.0 /usr/lib/sparcv9/crti.o /usr/ccs/lib/sparcv9/values-Xa.o /opt/csw/lib/gcc/sparc-sun-solaris2.10/4.9.2/sparcv9/crtbegin.o -L/usr/local/lib -L/usr/lib/mps -L/opt/csw/lib/gcc/sparc-sun-solaris2.10/4.9.2/sparcv9 -L/usr/ccs/lib/sparcv9 -L/opt/csw/lib/gcc/sparc-sun-solaris2.10/4.9.2/../../../sparcv9 -L/lib/sparcv9 -L/usr/lib/sparcv9 -L/opt/csw/lib/gcc/sparc-sun-solaris2.10/4.9.2 -L/opt/csw/lib/gcc/sparc-sun-solaris2.10/4.9.2/../../../../sparc-sun-solaris2.10/lib -L/usr/ccs/lib -L/opt/csw/lib/gcc/sparc-sun-solaris2.10/4.9.2/../../.. -hlibqpidcommon.so.2 CMakeFiles/qpidcommon.dir/qpid/framing/AMQP_AllProxy.cpp.o CMakeFiles/qpidcommon.dir/qpid/framing/ExchangeDeclareBody.cpp.o CMakeFiles/qpidcommon.dir/qpid/framing/MessageCancelBody.cpp.o CMakeFiles/qpidcommon.dir/qpid/framing/TxRollbackBody.cpp.o CMakeFiles/qpidcommon.dir/qpid/framing/FilePublishBody.cpp.o CMakeFiles/qpidcommon.dir/qpid/framing/FileAckBody.cpp.o CMakeFiles/qpidcommon.dir/qpid/framing/SessionCompletedBody.cpp.o CMakeFiles/qpidcommon.dir/qpid/framing/SessionDetachedBody.cpp.o CMakeFiles/qpidcommon.dir/qpid/framing/FileRejectBody.cpp.o CMakeFiles/qpidcommon.dir/qpid/framing/SessionExpectedBody.cpp.o CMakeFiles/qpidcommon.dir/qpid/framing/MessageAcceptBody.cpp.o CMakeFiles/qpidcommon.dir/qpid/framing/DtxStartBody.cpp.o CMakeFiles/qpidcommon.dir/qpid/framing/StreamCancelBody.cpp.o CMakeFiles/qpidcommon.dir/qpid/framing/StreamPublishBody.cpp.o CMakeFiles/qpidcommon.dir/qpid/framing/ConnectionStartOkBody.cpp.o CMakeFiles/qpidcommon.dir/qpid/framing/ServerInvoker.cpp.o CMakeFiles/qpidcommon.dir/qpid/framing/FileOpenOkBody.cpp.o CMakeFiles/qpidcommon.dir/qpid/framing/FileConsumeBody.cpp.o CMakeFiles/qpidcommon.dir/qpid/framing/ExchangeBoundResult.cpp.o CMakeFiles/qpidcommon.dir/qpid/framing/DtxRollbackBody.cpp.o CMakeFiles/qpidcommon.dir/qpid/framing/QueueQueryBody.cpp.o CMakeFiles/qpidcommon.dir/qpid/framing/MessageAcquireBody.cpp.o CMakeFiles/qpidcommon.dir/qpid/framing/StreamConsumeBody.cpp.o CMakeFiles/qpidcommon.dir/qpid/framing/SessionAttachedBody.cpp.o CMakeFiles/qpidcommon.dir/qpid/framing/TxCommitBody.cpp.o CMakeFiles/qpidcommon.dir/qpid/framing/MessageFlushBody.cpp.o CMakeFiles/qpidcommon.dir/qpid/framing/AMQP_ClientProxy.cpp.o CMakeFiles/qpidcommon.dir/qpid/framing/MessageSetFlowModeBody.cpp.o CMakeFiles/qpidcommon.dir/qpid/framing/MethodBodyFactory.cpp.o CMakeFiles/qpidcommon.dir/qpid/framing/FragmentProperties.cpp.o CMakeFiles/qpidcommon.dir/qpid/framing/FileDeliverBody.cpp.o CMakeFiles/qpidcommon.dir/qpid/framing/ConnectionCloseBody.cpp.o CMakeFiles/qpidcommon.dir/qpid/framing/QueueQueryResult.cpp.o CMakeFiles/qpidcommon.dir/qpid/framing/SessionConfirmedBody.cpp.o CMakeFiles/qpidcommon.dir/qpid/framing/ExecutionExceptionBody.cpp.o CMakeFiles/qpidcommon.dir/qpid/framing/ConnectionRedirectBody.cpp.o CMakeFiles/qpidcommon.dir/qpid/framing/SessionKnownCompletedBody.cpp.o CMakeFiles/qpidcommon.dir/qpid/framing/MessageReleaseBody.cpp.o CMakeFiles/qpidcommon.dir/qpid/framing/MessageRejectBody.cpp.o CMakeFiles/qpidcommon.dir/qpid/framing/Xid.cpp.o CMakeFiles/qpidcommon.dir/qpid/framing/SessionAttachBody.cpp.o CMakeFiles/qpidcommon.dir/qpid/framing/XaResult.cpp.o CMakeFiles/qpidcommon.dir/qpid/framing/DtxSetTimeoutBody.cpp.o CMakeFiles/qpidcommon.dir/qpid/framing/ExchangeBindBody.cpp.o CMakeFiles/qpidcommon.dir/qpid/framing/ExecutionResultBody.cpp.o CMakeFiles/qpidcommon.dir/qpid/framing/FileConsumeOkBody.cpp.o CMakeFiles/qpidcommon.dir/qpid/framing/FileQosBody.cpp.o CMakeFiles/qpidcommon.dir/qpid/framing/SessionRequestTimeoutBody.cpp.o CMakeFiles/qpidcommon.dir/qpid/framing/FileProperties.cpp.o CMakeFiles/qpidcommon.dir/qpid/framing/SessionFlushBody.cpp.o CMakeFiles/qpidcommon.dir/qpid/framing/MessageTransferBody.cpp.o CMakeFiles/qpidcommon.dir/qpid/framing/ReplyTo.cpp.o CMakeFiles/qpidcommon.dir/qpid/framing/StreamReturnBody.cpp.o CMakeFiles/qpidcommon.dir/qpid/framing/MessageAcquireResult.cpp.o CMakeFiles/qpidcommon.dir/qpid/framing/DtxSelectBody.cpp.o CMakeFiles/qpidcommon.dir/qpid/framing/StreamProperties.cpp.o CMakeFiles/qpidcommon.dir/qpid/framing/AMQP_ServerProxy.cpp.o CMakeFiles/qpidcommon.dir/qpid/framing/ConnectionTuneOkBody.cpp.o CMakeFiles/qpidcommon.dir/qpid/framing/ExchangeUnbindBody.cpp.o CMakeFiles/qpidcommon.dir/qpid/framing/reply_exceptions.cpp.o CMakeFiles/qpidcommon.dir/qpid/framing/DeliveryProperties.cpp.o CMakeFiles/qpidcommon.dir/qpid/framing/FileReturnBody.cpp.o CMakeFiles/qpidcommon.dir/qpid/framing/DtxGetTimeoutBody.cpp.o CMakeFiles/qpidcommon.dir/qpid/framing/QueueDeclareBody.cpp.o CMakeFiles/qpidcommon.dir/qpid/framing/TypeCode.cpp.o CMakeFiles/qpidcommon.dir/qpid/framing/DtxCommitBody.cpp.o CMakeFiles/qpidcommon.dir/qpid/framing/DtxGetTimeoutResult.cpp.o CMakeFiles/qpidcommon.dir/qpid/framing/ConnectionOpenOkBody.cpp.o CMakeFiles/qpidcommon.dir/qpid/framing/MethodBodyDefaultVisitor.cpp.o CMakeFiles/qpidcommon.dir/qpid/framing/FileQosOkBody.cpp.o CMakeFiles/qpidcommon.dir/qpid/framing/ExchangeQueryBody.cpp.o CMakeFiles/qpidcommon.dir/qpid/framing/StreamQosBody.cpp.o CMakeFiles/qpidcommon.dir/qpid/framing/ConnectionOpenBody.cpp.o CMakeFiles/qpidcommon.dir/qpid/framing/FileStageBody.cpp.o CMakeFiles/qpidcommon.dir/qpid/framing/Header.cpp.o CMakeFiles/qpidcommon.dir/qpid/framing/ExchangeBoundBody.cpp.o CMakeFiles/qpidcommon.dir/qpid/framing/MessageResumeResult.cpp.o CMakeFiles/qpidcommon.dir/qpid/framing/SessionCommandPointBody.cpp.o CMakeFiles/qpidcommon.dir/qpid/framing/MessageResumeBody.cpp.o CMakeFiles/qpidcommon.dir/qpid/framing/DtxRecoverResult.cpp.o CMakeFiles/qpidcommon.dir/qpid/framing/StreamDeliverBody.cpp.o CMakeFiles/qpidcommon.dir/qpid/framing/AllInvoker.cpp.o CMakeFiles/qpidcommon.dir/qpid/framing/DtxRecoverBody.cpp.o CMakeFiles/qpidcommon.dir/qpid/framing/ClientInvoker.cpp.o CMakeFiles/qpidcommon.dir/qpid/framing/SessionGapBody.cpp.o CMakeFiles/qpidcommon.dir/qpid/framing/SessionTimeoutBody.cpp.o CMakeFiles/qpidcommon.dir/qpid/framing/ExchangeDeleteBody.cpp.o CMakeFiles/qpidcommon.dir/qpid/framing/ConnectionSecureOkBody.cpp.o CMakeFiles/qpidcommon.dir/qpid/framing/SessionDetachBody.cpp.o CMakeFiles/qpidcommon.dir/qpid/framing/ConnectionStartBody.cpp.o CMakeFiles/qpidcommon.dir/qpid/framing/FileCancelBody.cpp.o CMakeFiles/qpidcommon.dir/qpid/framing/MessageFlowBody.cpp.o CMakeFiles/qpidcommon.dir/qpid/framing/QueueDeleteBody.cpp.o CMakeFiles/qpidcommon.dir/qpid/framing/ConnectionSecureBody.cpp.o CMakeFiles/qpidcommon.dir/qpid/framing/DtxForgetBody.cpp.o CMakeFiles/qpidcommon.dir/qpid/framing/ConnectionCloseOkBody.cpp.o CMakeFiles/qpidcommon.dir/qpid/framing/TxSelectBody.cpp.o CMakeFiles/qpidcommon.dir/qpid/framing/DtxPrepareBody.cpp.o CMakeFiles/qpidcommon.dir/qpid/framing/ConnectionHeartbeatBody.cpp.o CMakeFiles/qpidcommon.dir/qpid/framing/DtxEndBody.cpp.o CMakeFiles/qpidcommon.dir/qpid/framing/ExecutionSyncBody.cpp.o CMakeFiles/qpidcommon.dir/qpid/framing/ExchangeQueryResult.cpp.o CMakeFiles/qpidcommon.dir/qpid/framing/QueuePurgeBody.cpp.o CMakeFiles/qpidcommon.dir/qpid/framing/StreamQosOkBody.cpp.o CMakeFiles/qpidcommon.dir/qpid/framing/MessageStopBody.cpp.o CMakeFiles/qpidcommon.dir/qpid/framing/StreamConsumeOkBody.cpp.o CMakeFiles/qpidcommon.dir/qpid/framing/FileOpenBody.cpp.o CMakeFiles/qpidcommon.dir/qpid/framing/MessageSubscribeBody.cpp.o CMakeFiles/qpidcommon.dir/qpid/framing/ConnectionTuneBody.cpp.o CMakeFiles/qpidcommon.dir/qpid/framing/MessageProperties.cpp.o CMakeFiles/qpidcommon.dir/qpid/sys/posix/AsynchIO.cpp.o CMakeFiles/qpidcommon.dir/qpid/sys/posix/Condition.cpp.o CMakeFiles/qpidcommon.dir/qpid/sys/posix/Fork.cpp.o CMakeFiles/qpidcommon.dir/qpid/sys/posix/Path.cpp.o CMakeFiles/qpidcommon.dir/qpid/sys/posix/FileSysDir.cpp.o CMakeFiles/qpidcommon.dir/qpid/sys/posix/IOHandle.cpp.o CMakeFiles/qpidcommon.dir/qpid/sys/posix/LockFile.cpp.o CMakeFiles/qpidcommon.dir/qpid/sys/posix/MemoryMappedFile.cpp.o CMakeFiles/qpidcommon.dir/qpid/sys/posix/Mutex.cpp.o CMakeFiles/qpidcommon.dir/qpid/sys/posix/PipeHandle.cpp.o CMakeFiles/qpidcommon.dir/qpid/sys/posix/PollableCondition.cpp.o CMakeFiles/qpidcommon.dir/qpid/sys/posix/Shlib.cpp.o CMakeFiles/qpidcommon.dir/qpid/log/posix/SinkOptions.cpp.o CMakeFiles/qpidcommon.dir/qpid/sys/posix/BSDSocket.cpp.o CMakeFiles/qpidcommon.dir/qpid/sys/posix/SocketAddress.cpp.o CMakeFiles/qpidcommon.dir/qpid/sys/posix/StrError.cpp.o CMakeFiles/qpidcommon.dir/qpid/sys/posix/Thread.cpp.o CMakeFiles/qpidcommon.dir/qpid/sys/posix/Time.cpp.o CMakeFiles/qpidcommon.dir/qpid/SaslFactory.cpp.o CMakeFiles/qpidcommon.dir/qpid/sys/solaris/SystemInfo.cpp.o CMakeFiles/qpidcommon.dir/qpid/sys/posix/PosixPoller.cpp.o CMakeFiles/qpidcommon.dir/qpid/sys/cyrus/CyrusSecurityLayer.cpp.o CMakeFiles/qpidcommon.dir/qpid/sys/ssl/check.cpp.o CMakeFiles/qpidcommon.dir/qpid/sys/ssl/util.cpp.o CMakeFiles/qpidcommon.dir/qpid/sys/ssl/SslSocket.cpp.o CMakeFiles/qpidcommon.dir/qpid/assert.cpp.o CMakeFiles/qpidcommon.dir/qpid/AclHost.cpp.o CMakeFiles/qpidcommon.dir/qpid/Address.cpp.o CMakeFiles/qpidcommon.dir/qpid/DataDir.cpp.o CMakeFiles/qpidcommon.dir/qpid/Exception.cpp.o CMakeFiles/qpidcommon.dir/qpid/Modules.cpp.o CMakeFiles/qpidcommon.dir/qpid/Options.cpp.o CMakeFiles/qpidcommon.dir/qpid/Plugin.cpp.o CMakeFiles/qpidcommon.dir/qpid/RefCountedBuffer.cpp.o CMakeFiles/qpidcommon.dir/qpid/SessionState.cpp.o CMakeFiles/qpidcommon.dir/qpid/SessionId.cpp.o CMakeFiles/qpidcommon.dir/qpid/StringUtils.cpp.o CMakeFiles/qpidcommon.dir/qpid/Url.cpp.o CMakeFiles/qpidcommon.dir/qpid/UrlArray.cpp.o CMakeFiles/qpidcommon.dir/qpid/NullSaslClient.cpp.o CMakeFiles/qpidcommon.dir/qpid/NullSaslServer.cpp.o CMakeFiles/qpidcommon.dir/qpid/amqp_0_10/SessionHandler.cpp.o CMakeFiles/qpidcommon.dir/qpid/framing/AccumulatedAck.cpp.o CMakeFiles/qpidcommon.dir/qpid/framing/AMQBody.cpp.o CMakeFiles/qpidcommon.dir/qpid/framing/AMQMethodBody.cpp.o CMakeFiles/qpidcommon.dir/qpid/framing/AMQContentBody.cpp.o CMakeFiles/qpidcommon.dir/qpid/framing/AMQFrame.cpp.o CMakeFiles/qpidcommon.dir/qpid/framing/AMQHeaderBody.cpp.o CMakeFiles/qpidcommon.dir/qpid/framing/AMQHeartbeatBody.cpp.o CMakeFiles/qpidcommon.dir/qpid/framing/Array.cpp.o CMakeFiles/qpidcommon.dir/qpid/framing/Buffer.cpp.o CMakeFiles/qpidcommon.dir/qpid/framing/FieldTable.cpp.o CMakeFiles/qpidcommon.dir/qpid/framing/FieldValue.cpp.o CMakeFiles/qpidcommon.dir/qpid/framing/FrameSet.cpp.o CMakeFiles/qpidcommon.dir/qpid/framing/FrameDecoder.cpp.o CMakeFiles/qpidcommon.dir/qpid/framing/List.cpp.o CMakeFiles/qpidcommon.dir/qpid/framing/ProtocolInitiation.cpp.o CMakeFiles/qpidcommon.dir/qpid/framing/ProtocolVersion.cpp.o CMakeFiles/qpidcommon.dir/qpid/framing/SendContent.cpp.o CMakeFiles/qpidcommon.dir/qpid/framing/SequenceNumber.cpp.o CMakeFiles/qpidcommon.dir/qpid/framing/SequenceNumberSet.cpp.o CMakeFiles/qpidcommon.dir/qpid/framing/SequenceSet.cpp.o CMakeFiles/qpidcommon.dir/qpid/framing/Proxy.cpp.o CMakeFiles/qpidcommon.dir/qpid/framing/Uuid.cpp.o CMakeFiles/qpidcommon.dir/qpid/framing/TransferContent.cpp.o CMakeFiles/qpidcommon.dir/qpid/log/Logger.cpp.o CMakeFiles/qpidcommon.dir/qpid/log/Options.cpp.o CMakeFiles/qpidcommon.dir/qpid/log/OstreamOutput.cpp.o CMakeFiles/qpidcommon.dir/qpid/log/Selector.cpp.o CMakeFiles/qpidcommon.dir/qpid/log/Statement.cpp.o CMakeFiles/qpidcommon.dir/qpid/management/Buffer.cpp.o CMakeFiles/qpidcommon.dir/qpid/management/ConnectionSettings.cpp.o CMakeFiles/qpidcommon.dir/qpid/management/Mutex.cpp.o CMakeFiles/qpidcommon.dir/qpid/management/Manageable.cpp.o CMakeFiles/qpidcommon.dir/qpid/management/ManagementObject.cpp.o CMakeFiles/qpidcommon.dir/qpid/sys/AggregateOutput.cpp.o CMakeFiles/qpidcommon.dir/qpid/sys/AsynchIOHandler.cpp.o CMakeFiles/qpidcommon.dir/qpid/sys/Dispatcher.cpp.o CMakeFiles/qpidcommon.dir/qpid/sys/DispatchHandle.cpp.o CMakeFiles/qpidcommon.dir/qpid/sys/Runnable.cpp.o CMakeFiles/qpidcommon.dir/qpid/sys/Shlib.cpp.o CMakeFiles/qpidcommon.dir/qpid/sys/Timer.cpp.o CMakeFiles/qpidcommon.dir/qpid/sys/TimerWarnings.cpp.o CMakeFiles/qpidcommon.dir/qpid/amqp_0_10/Codecs.cpp.o CMakeFiles/qpidcommon.dir/qpid/amqp/CharSequence.cpp.o CMakeFiles/qpidcommon.dir/qpid/amqp/DataBuilder.cpp.o CMakeFiles/qpidcommon.dir/qpid/amqp/Decoder.cpp.o CMakeFiles/qpidcommon.dir/qpid/amqp/Descriptor.cpp.o CMakeFiles/qpidcommon.dir/qpid/amqp/Encoder.cpp.o CMakeFiles/qpidcommon.dir/qpid/amqp/ListBuilder.cpp.o CMakeFiles/qpidcommon.dir/qpid/amqp/MapEncoder.cpp.o CMakeFiles/qpidcommon.dir/qpid/amqp/MapSizeCalculator.cpp.o CMakeFiles/qpidcommon.dir/qpid/amqp/MapBuilder.cpp.o CMakeFiles/qpidcommon.dir/qpid/amqp/MapReader.cpp.o CMakeFiles/qpidcommon.dir/qpid/amqp/MessageEncoder.cpp.o CMakeFiles/qpidcommon.dir/qpid/amqp/MessageId.cpp.o CMakeFiles/qpidcommon.dir/qpid/amqp/MessageReader.cpp.o CMakeFiles/qpidcommon.dir/qpid/amqp/Sasl.cpp.o CMakeFiles/qpidcommon.dir/qpid/amqp/SaslClient.cpp.o CMakeFiles/qpidcommon.dir/qpid/amqp/SaslServer.cpp.o CMakeFiles/qpidcommon.dir/qpid/messaging/amqp/Transport.cpp.o CMakeFiles/qpidcommon.dir/qpid/sys/MemStat.cpp.o libqpidtypes.so.1.0.0 -ldl -lrt /usr/local/lib/libboost_program_options.so -lsasl2 -lnss3 -lsmime3 -lssl3 -lnssutil3 -lplds4 -lplc4 -lnspr4 -lpthread -ldl -lposix4 -lrt /usr/local/lib/libboost_program_options.so -lsasl2 -lnss3 -lsmime3 -lssl3 -lnssutil3 -lplds4 -lplc4 -lnspr4 -lpthread -lposix4 -R/usr/local/lib:/usr/lib/mps:/export/home/user/qpid-cpp-0.34/build/src: -lgcc_s -lpthread -lc -R /opt/csw/lib/64 -lgcc_s -lpthread -lc -R /opt/csw/lib/64 /opt/csw/lib/gcc/sparc-sun-solaris2.10/4.9.2/sparcv9/crtend.o /usr/lib/sparcv9/crtn.o

SPARC 64 位二进制文​​件可能需要比 -fpic 选项提供的更大的重定位 table。使用 -fPIC(大写)。 See Oracles Linker and Libraries Guide:

SPARC: -Kpic and -KPIC Options

For SPARC binaries, a subtle difference between the -K pic option and an alternative -K PIC option affects references to global offset table entries. ...

尝试使用 Solaris Studio 编译器进行编译,您可能会收到更具描述性的错误消息,例如链接的 Oracle 文档中列出的错误消息。

没有足够的信息来完全解释或解决您的问题,但我可以提供一些 "hints"。重定位R_SPARC_TLS_LDO_ADD用于实现thread-local storage. Specifically it's used with the the local dynamic TLS model, one of the four models used to implement TLS.

当本地动态模型用于引用 TLS 变量时,需要在引用它的同一个动态对象(共享库)中定义该变量。您收到的错误表明函数 qpid::sys::DeletionManager<qpid::sys::PollerHandlePrivate>::getThreadStatus 中定义的 thead 局部静态变量 threadStatus 未在正在创建的共享库 (libqpidcommon.so.2.0.0) 中的任何位置定义。相反,它是在与其链接的其他一些共享库中定义的(可能 libqpidtypes.so.1.0.0)。

生成此错误的原因尚不清楚。在使用 -fpic 编译时通过 default GCC uses the global dynamic model。当使用全局动态模型引用线程局部变量时,它们可以在任何共享库中,而不仅仅是正在创建的共享库中。您可以尝试显式使用 -ftls-model=global-dynamic 选项,但除非某些东西显式使用 -ftls-model=local-dynamic ,否则这不会有任何效果。

GCC 可能错误地优化了对 threadStatus 的引用。如果 GCC 确定线程局部变量无法从不同的翻译单元访问,它将使用局部动态模型来引用它,因为该模型比更通用的全局动态模型更快。问题也可能是由于您正在编译的源代码中的某些内容、makefile 中的错误或链接器中的错误。