VirLinden avatar VirLinden committed ae5c83d

MAINT-515 FIX, CHOP-100 FIX - technically we are avoiding these issues rather than fixing them; changing llcommon to be statically linked avoids the symbol issues with llcommon.dll

Comments (0)

Files changed (4)

indra/cmake/LLAddBuildTest.cmake

   endif(TEST_DEBUG)
   ADD_EXECUTABLE(INTEGRATION_TEST_${testname} ${source_files})
   SET_TARGET_PROPERTIES(INTEGRATION_TEST_${testname} PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${EXE_STAGING_DIR}")
+  if (WINDOWS)
+    set_target_properties(INTEGRATION_TEST_${testname}
+      PROPERTIES 
+      LINK_FLAGS "/debug /NODEFAULTLIB:LIBCMT /SUBSYSTEM:WINDOWS /INCLUDE:__tcmalloc"
+      LINK_FLAGS_DEBUG "/NODEFAULTLIB:\"LIBCMT;LIBCMTD;MSVCRT\" /INCREMENTAL:NO"
+      LINK_FLAGS_RELEASE ""
+      )
+  endif(WINDOWS)
+
   if(STANDALONE)
     SET_TARGET_PROPERTIES(INTEGRATION_TEST_${testname} PROPERTIES COMPILE_FLAGS -I"${TUT_INCLUDE_DIR}")
   endif(STANDALONE)

indra/cmake/LLCommon.cmake

 
 add_definitions(${TCMALLOC_FLAG})
 
-set(LLCOMMON_LINK_SHARED ON CACHE BOOL "Build the llcommon target as a shared library.")
+set(LLCOMMON_LINK_SHARED OFF CACHE BOOL "Build the llcommon target as a shared library.")
 if(LLCOMMON_LINK_SHARED)
   add_definitions(-DLL_COMMON_LINK_SHARED=1)
 endif(LLCOMMON_LINK_SHARED)

indra/llcommon/llstat.cpp

 S32	            LLPerfBlock::sStatsFlags = LLPerfBlock::LLSTATS_NO_OPTIONAL_STATS;       // Control what is being recorded
 LLPerfBlock::stat_map_t    LLPerfBlock::sStatMap;    // Map full path string to LLStatTime objects, tracks all active objects
 std::string        LLPerfBlock::sCurrentStatPath = "";    // Something like "/total_time/physics/physics step"
-LLStat::stat_map_t LLStat::sStatList;
 
 //------------------------------------------------------------------------
 // Live config file to trigger stats logging
 
 	if (!mName.empty())
 	{
-		stat_map_t::iterator iter = sStatList.find(mName);
-		if (iter != sStatList.end())
+		stat_map_t::iterator iter = getStatList().find(mName);
+		if (iter != getStatList().end())
 			llwarns << "LLStat with duplicate name: " << mName << llendl;
-		sStatList.insert(std::make_pair(mName, this));
+		getStatList().insert(std::make_pair(mName, this));
 	}
 }
 
+LLStat::stat_map_t& LLStat::getStatList()
+{
+	static LLStat::stat_map_t stat_list;
+	return stat_list;
+}
+
 LLStat::LLStat(const U32 num_bins, const BOOL use_frame_timer)
 	: mUseFrameTimer(use_frame_timer),
 	  mNumBins(num_bins)
 	if (!mName.empty())
 	{
 		// handle multiple entries with the same name
-		stat_map_t::iterator iter = sStatList.find(mName);
-		while (iter != sStatList.end() && iter->second != this)
+		stat_map_t::iterator iter = getStatList().find(mName);
+		while (iter != getStatList().end() && iter->second != this)
 			++iter;
-		sStatList.erase(iter);
+		getStatList().erase(iter);
 	}
 }
 

indra/llcommon/llstat.h

 {
 private:
 	typedef std::multimap<std::string, LLStat*> stat_map_t;
-	static stat_map_t sStatList;
 
 	void init();
+	static stat_map_t& getStatList();
 
 public:
 	LLStat(U32 num_bins = 32, BOOL use_frame_timer = FALSE);
 	static LLStat* getStat(const std::string& name)
 	{
 		// return the first stat that matches 'name'
-		stat_map_t::iterator iter = sStatList.find(name);
-		if (iter != sStatList.end())
+		stat_map_t::iterator iter = getStatList().find(name);
+		if (iter != getStatList().end())
 			return iter->second;
 		else
 			return NULL;
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.