Beginner
Beginner

Reputation: 5467

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

I am trying to build Apache Qpid on a SPARC running Solaris 10. By now libqpidtypes.so builds, but libqpidcommon.so does not link.

After compilation the linker creates a lot of error messages like this:

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

I have build the required boost library program_options like this:

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

Google produces two unhelpful search results to "relocation illegal when not bound to object being created"

Question: can you give me a hint what the error message is telling me?


Edit:

If I comment out the thread-local storage specifier, Qpid compiles and links successfully. Of course this is not correct behaviour at runtime.

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;
    }

Here is the complete error message:

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'


Edit: here is the linker command

/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

Upvotes: 1

Views: 670

Answers (2)

Ross Ridge
Ross Ridge

Reputation: 39621

There's not enough information to fully explain or solve your problem, but I can offer some "hints". The relocation R_SPARC_TLS_LDO_ADD is used to implement thread-local storage. Specifically it's used with the the local dynamic TLS model, one of the four models used to implement TLS.

When the local dynamic model is used to refer to a TLS variable, that variable needs to be defined in the same dynamic object (shared library) that refers to it. The error you're getting indicates that the thead local static variable threadStatus defined in the function qpid::sys::DeletionManager<qpid::sys::PollerHandlePrivate>::getThreadStatus isn't defined anywhere in the shared library being created (libqpidcommon.so.2.0.0). Instead it's defined in some other shared library its being linked with (probably libqpidtypes.so.1.0.0).

Why this error is being generated is unclear. By default GCC uses the global dynamic model when compiling with -fpic. When thread-local variables are referenced using the global dynamic model they can be in any shared library, not just the one being created. You can try using the -ftls-model=global-dynamic option explicitly, but unless something is using -ftls-model=local-dynamic explicitly, this shouldn't have any effect.

It's possible that GCC is incorrectly optimizing references to threadStatus. If GCC determines that a thread-local variable can't be accessed from a different translation unit it will use the local dynamic model to reference it, as this model is faster than the more general global dynamic model. The problem could also be because of something in the source code you're compiling, an error in the makefile or a bug in the linker.

Upvotes: 2

Andrew Henle
Andrew Henle

Reputation: 1

SPARC 64-bit binaries may require a larger relocation table than provided by the -fpic option. Use -fPIC (upper case). 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. ...

Try compiling with Solaris Studio compilers and you'll likely get a more descriptive error message such as the ones listed in the linked Oracle document.

Upvotes: 2

Related Questions