From 3228ac1cbb8c63fbc8f75e24efd730e7d1fa8c3b Mon Sep 17 00:00:00 2001 From: akumta Date: Thu, 19 Nov 2015 11:00:09 -0800 Subject: [PATCH] See boost ticket #11807 for details Several python tests fail with the following error message when compiling with Oracle Solaris Studio compilers with -std=[c++03,c++11], modes. ImportError?: ld.so.1: isapython2.6: fatal: relocation error: file /export/home/boost_regression_develop/boost_sparc-S2_cpp11/results/boost/bin.v2/libs/python/test/injected.test/sun-next_cpp11/ release/threading-multi/injected_ext.so: symbol _ZTIv: referenced symbol not found These errors occur when any libraries that are linked into the application that has no C++11 runtime already linked in. When creating shared libraries, replacing '-G' with '-G -library=stdcpp,CrunG3' seems to resolve the issue. --- src/tools/sun.jam | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/tools/sun.jam b/src/tools/sun.jam index ea6f7e36ab..876f52553a 100644 --- a/src/tools/sun.jam +++ b/src/tools/sun.jam @@ -148,11 +148,15 @@ actions link bind LIBRARIES rule link.dll ( targets * : sources * : properties * ) { SPACE on $(targets) = " " ; + if [ MATCH "(-std=c\\+\\+[03,11])" : [ on $(targets) return $(OPTIONS) ] ] + { + STDLIBOPT on $(targets) = -library=stdcpp,CrunG3 ; + } } actions link.dll bind LIBRARIES { - "$(CONFIG_COMMAND)" $(OPTIONS) -L"$(LINKPATH)" -R"$(RPATH)" -o "$(<)" -h$(<[1]:D=) -G "$(>)" "$(LIBRARIES)" -Bdynamic -l$(FINDLIBS-SA) -Bstatic -l$(FINDLIBS-ST) -B$(LINK-RUNTIME) + "$(CONFIG_COMMAND)" $(OPTIONS) -L"$(LINKPATH)" -R"$(RPATH)" -o "$(<)" -h$(<[1]:D=) -G $(STDLIBOPT) "$(>)" "$(LIBRARIES)" -Bdynamic -l$(FINDLIBS-SA) -Bstatic -l$(FINDLIBS-ST) -B$(LINK-RUNTIME) } # Declare action for creating static libraries