[Boost-bugs] [Boost C++ Libraries] #11544: Error: Linker scopes may not change after symbol definition.

Subject: [Boost-bugs] [Boost C++ Libraries] #11544: Error: Linker scopes may not change after symbol definition.
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2015-08-18 06:14:42


#11544: Error: Linker scopes may not change after symbol definition.
----------------------------+----------------------------------
 Reporter: lcarreon@… | Type: Bugs
   Status: new | Milestone: To Be Determined
Component: Building Boost | Version: Boost 1.59.0
 Severity: Problem | Keywords: regex, serialization
----------------------------+----------------------------------
 I compiled Boost 1.59.0 with Solaris Studio 12.4 in C++11 mode and I
 get the following error messages:

 "./boost/regex/v4/instances.hpp", line 172: Error: Linker scopes may not
 change after symbol definition.
 "./boost/regex/v4/instances.hpp", line 174: Error: Linker scopes may not
 change after symbol definition.
 "libs/serialization/src/basic_archive.cpp", line 45: Error: Linker scopes
 may only be more restrictive.
 "libs/serialization/src/basic_archive.cpp", line 79: Error: Linker scopes
 may only be more restrictive.
 "libs/serialization/src/basic_xml_archive.cpp", line 18: Error: Linker
 scopes may only be more restrictive.
 "libs/serialization/src/basic_xml_archive.cpp", line 22: Error: Linker
 scopes may only be more restrictive.
 "libs/serialization/src/void_cast.cpp", line 315: Error: Linker scopes may
 only be more restrictive.
 "libs/serialization/src/void_cast.cpp", line 349: Error: Linker scopes may
 only be more restrictive.

 dmr195 on stackoverflow.com suggested the temporary fix of removing
 the following lines in boost/config/compiler/sunpro_cc.hpp:

 //
 // Dynamic shared object (DSO) and dynamic-link library (DLL) support
 //
 #if __SUNPRO_CC > 0x500
 # define BOOST_SYMBOL_EXPORT __global
 # define BOOST_SYMBOL_IMPORT __global
 # define BOOST_SYMBOL_VISIBLE __global
 #endif

 For now I agree with him that everything works even without symbol
 scoping. It just means that the linker has to deal with a lot more
 symbols than it needs to.

 According to the Solaris Studio 12.4 C++ User's Guide, to achieve
 linker scoping equivalent to Visual Studio's scoping the compiler
 option -xldscope=hidden must be used in combination with the following:

 __symbolic (equivalent to __declspec(dllexport))
 __global (equivalent to __declspec(dllimport))

 The above user's guide also specifically warned to use __global only
 on symbol declarations, not symbol definitions.

 This warning is most likely the reason why the errors in regex are
 happening.

 BTW, I tried simply changing __global to __symbolic in the definition
 of BOOST_SYMBOL_EXPORT without any luck. This may mean that either
 BOOST_SYMBOL_EXPORT or BOOST_SYMBOL_IMPORT is not used correctly.

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/11544>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.

This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:18 UTC