[SERVER-9890] Solaris/SmartOS client program "authTest" fails with "relocation error: R_AMD64_PC32" Created: 10/Jun/13  Updated: 11/Jul/16  Resolved: 17/Jun/13

Status: Closed
Project: Core Server
Component/s: Build
Affects Version/s: 2.5.1
Fix Version/s: 2.4.5, 2.5.1

Type: Bug Priority: Major - P3
Reporter: Tad Marshall Assignee: Andrew Morrow (Inactive)
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

SmartOS Buildbot slave


Issue Links:
Depends
is depended on by SERVER-6514 scons --sharedclient mongoclient buil... Closed
Operating System: Solaris
Participants:

 Description   

http://buildbot.mongodb.org/builders/Nightly%20Solaris-SmartOS%2064-bit/builds/405/steps/test_9/logs/stdio

ld.so.1: authTest: fatal: relocation error: R_AMD64_PC32: file build/sunos5/64/cc__opt_local_bin_gcc/cpppath__usr_local_include/cxx__opt_local_bin_g++/extrapath__opt_local_/libpath__usr_local_lib/release/client_build/libmongoclient.so: symbol main: value 0x2801a398324 does not fit

This could be related to recent changes for creating a shared client library, or it may be related to the recent addition of blockCheckSupported features to Solaris.



 Comments   
Comment by Andrew Morrow (Inactive) [ 17/Jun/13 ]

The relevant tests passed on the Solaris buildbots on both master and v2.4 over the weekend.

Comment by auto [ 14/Jun/13 ]

Author:

{u'username': u'acmorrow', u'name': u'Andrew Morrow', u'email': u'acm@10gen.com'}

Message: SERVER-9890 Force the use of gnulink on solaris, since we always link through the compiler
(cherry picked from commit 58f82cf66d180a595c9e6801667c569c6d0eed98)
Branch: v2.4
https://github.com/mongodb/mongo/commit/5d5116a94ea779c7c4e694bcd74bc5775e98958a

Comment by auto [ 13/Jun/13 ]

Author:

{u'username': u'acmorrow', u'name': u'Andrew Morrow', u'email': u'acm@10gen.com'}

Message: SERVER-9890 Force the use of gnulink on solaris, since we always link through the compiler
Branch: master
https://github.com/mongodb/mongo/commit/58f82cf66d180a595c9e6801667c569c6d0eed98

Comment by Andrew Morrow (Inactive) [ 10/Jun/13 ]

The problem is that on solaris, SCons wants to build shared libraries with the -G flag, which is the shared library for the Solaris linker, not the binutils linker. This is probably due to SCons picking up the sunlink tool in preference to the gnulink tool. We will need to educate SCons that we always use GCC on 'nix.

Until we do this work, I will ask Ernie to disable the --sharedclient flag on Solaris/SmartOS.

Comment by Tad Marshall [ 10/Jun/13 ]

There is a nice explanation of what the error means at https://groups.google.com/forum/?fromgroups#!topic/comp.unix.programmer/-IVBzZ2kwx0 :

The "R_AMD64_PC32" relocation is used when a 32-bit PC-relative
offset is required when running in long mode (64-bit mode).  This
originally applied to the AMD Opteron, which is why the AMD64 is
in the relocation name, but the AMD64 symbols are also used on
Intel x86 family processors when running in long (64 bit) mode.
 
What it means is that the distance beween the symbol and the code
which is referencing the symbol exceeds the magnitude of a 32-bit
signed integer (2 to the 31st power).
 
This is likely because the symbol being referenced (__1cHCGenVar4nJCData__2t6M_v_)
which may be a mangled C++ name for a virtual table (through which the code will
indirectly branch to call virtual functions associated with the class) is located
in the .data section and the linker has laid out the code and data sections more
than 2GB apart (which is typical when you have a 64-bit address space).

Generated at Thu Feb 08 03:21:44 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.