From b0f295ec2a2fd448bb248befb5b57b26b6144332 Mon Sep 17 00:00:00 2001 From: Erik Kundiman Date: Wed, 12 Jul 2023 10:20:18 +0800 Subject: Disable copy 3rd party libs when using system libs --- indra/llcommon/CMakeLists.txt | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'indra/llcommon') diff --git a/indra/llcommon/CMakeLists.txt b/indra/llcommon/CMakeLists.txt index ef4899978e..c58956bd36 100644 --- a/indra/llcommon/CMakeLists.txt +++ b/indra/llcommon/CMakeLists.txt @@ -9,7 +9,9 @@ include(Linking) include(Boost) include(LLSharedLibs) include(JsonCpp) +if (USE_AUTOBUILD_3P OR USE_CONAN) include(Copy3rdPartyLibs) +endif () include(ZLIBNG) include(URIPARSER) include(Tracy) @@ -277,7 +279,9 @@ target_link_libraries( target_include_directories(llcommon INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}) target_include_directories(llcommon PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}) +if (USE_AUTOBUILD_3P OR USE_CONAN) add_dependencies(llcommon stage_third_party_libs) +endif () if (LL_TESTS) include(LLAddBuildTest) -- cgit v1.2.3 From 146f292869a0ca2a82768374c81ae519a5eee287 Mon Sep 17 00:00:00 2001 From: Erik Kundiman Date: Sun, 4 Jun 2023 10:38:31 +0800 Subject: stdtypes.h includes C Std Lib stddef.h for size_t in order to get rid of errors complaining that size_t was not declared in the scope. --- indra/llcommon/stdtypes.h | 1 + 1 file changed, 1 insertion(+) (limited to 'indra/llcommon') diff --git a/indra/llcommon/stdtypes.h b/indra/llcommon/stdtypes.h index da8512169c..192a8b97b1 100644 --- a/indra/llcommon/stdtypes.h +++ b/indra/llcommon/stdtypes.h @@ -29,6 +29,7 @@ #include #include #include +#include #include #include -- cgit v1.2.3 From 0f121ca6a6d1d505ca6cb49683c6a1ebb69e6a31 Mon Sep 17 00:00:00 2001 From: Erik Kundiman Date: Wed, 12 Jul 2023 12:28:07 +0800 Subject: Deprecated declarations aren't treated as errors I had added this to CMAKE_CXX_FLAGS in 00-Common before, and only when the compiler was Clang. But it turned out that GCC was treating them as errors too, that the addition would need to be applied to all compilers. So I prefer to put it here in llcommon with the scope set to PUBLIC cause the errors would show up again when compiling other LL libraries if the scope is set to something else. --- indra/llcommon/CMakeLists.txt | 2 ++ 1 file changed, 2 insertions(+) (limited to 'indra/llcommon') diff --git a/indra/llcommon/CMakeLists.txt b/indra/llcommon/CMakeLists.txt index c58956bd36..e5a3e5e0c7 100644 --- a/indra/llcommon/CMakeLists.txt +++ b/indra/llcommon/CMakeLists.txt @@ -281,6 +281,8 @@ target_include_directories(llcommon PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}) if (USE_AUTOBUILD_3P OR USE_CONAN) add_dependencies(llcommon stage_third_party_libs) +else () + target_compile_options(${PROJECT_NAME} PUBLIC -Wno-deprecated-declarations) endif () if (LL_TESTS) -- cgit v1.2.3 From e87035c17b23dc6cca2eea2b0ff9223314bb55ea Mon Sep 17 00:00:00 2001 From: Erik Kundiman Date: Wed, 12 Jul 2023 13:24:03 +0800 Subject: Start including FBSD for common macro definitions --- indra/llcommon/llfasttimer.cpp | 2 +- indra/llcommon/llfasttimer.h | 2 +- indra/llcommon/llmemory.h | 4 ++-- indra/llcommon/stdtypes.h | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) (limited to 'indra/llcommon') diff --git a/indra/llcommon/llfasttimer.cpp b/indra/llcommon/llfasttimer.cpp index 2612d0f07c..b30bb110c9 100644 --- a/indra/llcommon/llfasttimer.cpp +++ b/indra/llcommon/llfasttimer.cpp @@ -43,7 +43,7 @@ #if LL_WINDOWS #include "lltimer.h" -#elif LL_LINUX +#elif LL_LINUX || LL_FREEBSD #include #include #include "lltimer.h" diff --git a/indra/llcommon/llfasttimer.h b/indra/llcommon/llfasttimer.h index 9bd93d7240..53f936db34 100644 --- a/indra/llcommon/llfasttimer.h +++ b/indra/llcommon/llfasttimer.h @@ -159,7 +159,7 @@ public: #endif // (LL_LINUX) && !(defined(__i386__) || defined(__amd64__)) -#if (LL_LINUX || LL_DARWIN) && (defined(__i386__) || defined(__amd64__)) +#if (LL_LINUX || LL_DARWIN || LL_FREEBSD) && (defined(__i386__) || defined(__amd64__)) // // Mac+Linux FAST x86 implementation of CPU clock static U32 getCPUClockCount32() diff --git a/indra/llcommon/llmemory.h b/indra/llcommon/llmemory.h index ac6c969d70..b67a8c9bc0 100644 --- a/indra/llcommon/llmemory.h +++ b/indra/llcommon/llmemory.h @@ -52,7 +52,7 @@ class LLMutex ; #define LL_DEFAULT_HEAP_ALIGN 8 #elif LL_DARWIN #define LL_DEFAULT_HEAP_ALIGN 16 -#elif LL_LINUX +#elif LL_LINUX || LL_FREEBSD #define LL_DEFAULT_HEAP_ALIGN 8 #endif @@ -85,7 +85,7 @@ template T* LL_NEXT_ALIGNED_ADDRESS_64(T* address) (uintptr_t(address) + 0x3F) & ~0x3F); } -#if LL_LINUX || LL_DARWIN +#if LL_LINUX || LL_DARWIN || LL_FREEBSD #define LL_ALIGN_PREFIX(x) #define LL_ALIGN_POSTFIX(x) __attribute__((aligned(x))) diff --git a/indra/llcommon/stdtypes.h b/indra/llcommon/stdtypes.h index 192a8b97b1..bae4d7a5b1 100644 --- a/indra/llcommon/stdtypes.h +++ b/indra/llcommon/stdtypes.h @@ -72,7 +72,7 @@ typedef unsigned __int64 U64; #else typedef long long int S64; typedef long long unsigned int U64; -#if LL_DARWIN || LL_LINUX +#if LL_DARWIN || LL_LINUX || LL_FREEBSD #define S64L(a) (a##LL) #define U64L(a) (a##ULL) #endif -- cgit v1.2.3 From 368a9c7c61f8144eca48b12c5aac82b6a1d8c6bf Mon Sep 17 00:00:00 2001 From: Erik Kundiman Date: Wed, 12 Jul 2023 13:45:07 +0800 Subject: Undefine NULL before defining it to 0 on FreeBSD Since C++11, NULL is promoted to nullptr on some BSD platforms. This is very problematic when used with Boost. At times it would fail during compile-time. What's worse is if it passes compile-time, but then crash during run-time, for example when some condition is to be checked for its truth, when then it would be compared to a nullptr. --- indra/llcommon/stdtypes.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'indra/llcommon') diff --git a/indra/llcommon/stdtypes.h b/indra/llcommon/stdtypes.h index bae4d7a5b1..86af192a94 100644 --- a/indra/llcommon/stdtypes.h +++ b/indra/llcommon/stdtypes.h @@ -114,6 +114,10 @@ typedef U32 TPACKETID; #define FALSE (0) #endif +#if LL_FREEBSD +#undef NULL +#endif + #ifndef NULL #define NULL (0) #endif -- cgit v1.2.3 From 4ac9396ea4183016aeff12a86e7e470e5f325ae9 Mon Sep 17 00:00:00 2001 From: Erik Kundiman Date: Wed, 12 Jul 2023 14:17:59 +0800 Subject: Processor information implementation for FreeBSD Relies on sysctl, like on Darwin, and on parsing a file, like on Linux, except the file would be /var/run/dmesg.boot. --- indra/llcommon/llprocessor.cpp | 97 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 97 insertions(+) (limited to 'indra/llcommon') diff --git a/indra/llcommon/llprocessor.cpp b/indra/llcommon/llprocessor.cpp index 4a1a81f083..b3c05f5960 100644 --- a/indra/llcommon/llprocessor.cpp +++ b/indra/llcommon/llprocessor.cpp @@ -792,6 +792,100 @@ private: } }; +#elif LL_FREEBSD + +#include +class LLProcessorInfoFreeBSDImpl : public LLProcessorInfoImpl +{ +public: + LLProcessorInfoFreeBSDImpl() + { + size_t len = 0; + using std::string; + + char cpu_brand_string[0x40]; + len = sizeof cpu_brand_string; + memset(cpu_brand_string, '\0', len); + sysctlbyname("hw.model", (void *)cpu_brand_string, &len, + NULL, 0); + cpu_brand_string[0x3f] = '\0'; + setInfo(eBrandName, cpu_brand_string); + + uint64_t cpu_frequency = 0; + len = sizeof cpu_frequency; + sysctlbyname("hw.clockrate", (void *)&cpu_frequency, &len, + NULL, 0); + setInfo(eFrequency, (F64)cpu_frequency); + + auto dmesgboot = LLFile::fopen("/var/run/dmesg.boot", "rb"); + std::ostringstream s; + if (dmesgboot) { + char line[MAX_STRING]; + memset(line, 0, MAX_STRING); + while (fgets(line, MAX_STRING, dmesgboot)) { + line[strlen(line) - 1] = ' '; + s << line; + s << std::endl; + } + fclose(dmesgboot); + s << std::endl; + } + + auto dmesgboot_str = s.str(); + int decimal; + + auto idx1 = dmesgboot_str.find_first_of("\"") + 1; + auto idx2 = (idx1 != string::npos) + ? dmesgboot_str.find_first_of("\"", idx1) + : string::npos; + auto vendor = dmesgboot_str.substr(idx1, idx2 - idx1); + if (vendor.length() > 0) setInfo(eVendor, vendor.c_str()); + + idx1 = dmesgboot_str.find_first_of("=", idx2); + idx1 = dmesgboot_str.find_first_of("=", idx1 + 1) + 3; + idx2 = dmesgboot_str.find_first_of(" ", idx1); + auto family = dmesgboot_str.substr(idx1, idx2 - idx1); + std::istringstream(family) >> std::hex >> decimal; + setInfo(eFamily, decimal); + setInfo(eFamilyName, compute_CPUFamilyName(vendor.c_str(), + decimal, 0)); + + idx1 = dmesgboot_str.find_first_of("=", idx2) + 3; + idx2 = dmesgboot_str.find_first_of(" ", idx1); + auto model = dmesgboot_str.substr(idx1, idx2 - idx1); + std::istringstream(model) >> std::hex >> decimal; + setInfo(eModel, decimal); + + idx1 = dmesgboot_str.find_first_of("=", idx2) + 1; + idx2 = dmesgboot_str.find_first_of("\n", idx1); + auto stepping = dmesgboot_str.substr(idx1, idx2 - idx1); + setInfo(eStepping, std::stoi(stepping)); + + if (dmesgboot_str.find(",SSE,") != string::npos) + setExtension(cpu_feature_names[eSSE_Ext]); + + if (dmesgboot_str.find(",SSE2,") != string::npos) + setExtension(cpu_feature_names[eSSE2_Ext]); + + if (dmesgboot_str.find(" Date: Wed, 12 Jul 2023 14:37:28 +0800 Subject: Macro defs on FreeBSD as it's a supported arch now --- indra/llcommon/llsdutil.cpp | 2 +- indra/llcommon/lltimer.cpp | 6 +++--- indra/llcommon/lluuid.cpp | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) (limited to 'indra/llcommon') diff --git a/indra/llcommon/llsdutil.cpp b/indra/llcommon/llsdutil.cpp index f70bee9903..512f630cdc 100644 --- a/indra/llcommon/llsdutil.cpp +++ b/indra/llcommon/llsdutil.cpp @@ -36,7 +36,7 @@ # include // for htonl #elif LL_LINUX # include -#elif LL_DARWIN +#elif LL_DARWIN || LL_FREEBSD # include #endif diff --git a/indra/llcommon/lltimer.cpp b/indra/llcommon/lltimer.cpp index 58bedacf43..8d22d7fa5e 100644 --- a/indra/llcommon/lltimer.cpp +++ b/indra/llcommon/lltimer.cpp @@ -32,7 +32,7 @@ #if LL_WINDOWS # include "llwin32headerslean.h" -#elif LL_LINUX || LL_DARWIN +#elif LL_LINUX || LL_DARWIN || LL_FREEBSD # include # include #else @@ -74,7 +74,7 @@ U32 micro_sleep(U64 us, U32 max_yields) ms_sleep((U32)(us / 1000)); return 0; } -#elif LL_LINUX || LL_DARWIN +#elif LL_LINUX || LL_DARWIN || LL_FREEBSD static void _sleep_loop(struct timespec& thiswait) { struct timespec nextwait; @@ -192,7 +192,7 @@ F64 calc_clock_frequency() #endif // LL_WINDOWS -#if LL_LINUX || LL_DARWIN +#if LL_LINUX || LL_DARWIN || LL_FREEBSD // Both Linux and Mac use gettimeofday for accurate time F64 calc_clock_frequency() { diff --git a/indra/llcommon/lluuid.cpp b/indra/llcommon/lluuid.cpp index fc04dca08d..3b575c914c 100644 --- a/indra/llcommon/lluuid.cpp +++ b/indra/llcommon/lluuid.cpp @@ -606,7 +606,7 @@ S32 LLUUID::getNodeID(unsigned char *node_id) #define HAVE_NETINET_IN_H #ifdef HAVE_NETINET_IN_H #include -#if !LL_DARWIN +#if !LL_DARWIN && !LL_FREEBSD #include #endif #endif -- cgit v1.2.3 From bcab7e348022eb219ab1beafe7bb0e64f66495f0 Mon Sep 17 00:00:00 2001 From: Erik Kundiman Date: Wed, 12 Jul 2023 14:43:01 +0800 Subject: Operating system info implementation for FreeBSD --- indra/llcommon/llsys.cpp | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) (limited to 'indra/llcommon') diff --git a/indra/llcommon/llsys.cpp b/indra/llcommon/llsys.cpp index 91cb65b815..8c4e0988fc 100644 --- a/indra/llcommon/llsys.cpp +++ b/indra/llcommon/llsys.cpp @@ -83,6 +83,9 @@ using namespace llsd; # include const char MEMINFO_FILE[] = "/proc/meminfo"; # include +#elif LL_FREEBSD +# include +# include #endif LLCPUInfo gSysCPU; @@ -435,6 +438,14 @@ LLOSInfo::LLOSInfo() : if (simple.length() > 0) mOSStringSimple = simple; } + else if (ostype == "FreeBSD") + { + // Only care about major and minor FreeBSD versions, truncate at first '-' + std::string simple = mOSStringSimple.substr(0, + mOSStringSimple.find_first_of("-", 0)); + if (simple.length() > 0) + mOSStringSimple = simple; + } } else { @@ -776,10 +787,14 @@ U32Kilobytes LLMemoryInfo::getPhysicalMemoryKB() const #if LL_WINDOWS return LLMemoryAdjustKBResult(U32Kilobytes(mStatsMap["Total Physical KB"].asInteger())); -#elif LL_DARWIN +#elif LL_DARWIN || LL_FREEBSD // This might work on Linux as well. Someone check... uint64_t phys = 0; +#if LL_DARWIN int mib[2] = { CTL_HW, HW_MEMSIZE }; +#else + int mib[2] = { CTL_HW, HW_PHYSMEM }; +#endif size_t len = sizeof(phys); sysctl(mib, 2, &phys, &len, NULL, 0); -- cgit v1.2.3 From fc6d2ad320b35a7ea4dfa33d88e1bdd54d21904d Mon Sep 17 00:00:00 2001 From: Erik Kundiman Date: Wed, 12 Jul 2023 14:46:32 +0800 Subject: System xxHash header isn't (usually?) encapsulated --- indra/llcommon/hbxxh.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'indra/llcommon') diff --git a/indra/llcommon/hbxxh.cpp b/indra/llcommon/hbxxh.cpp index 388269d6c8..84d215d468 100644 --- a/indra/llcommon/hbxxh.cpp +++ b/indra/llcommon/hbxxh.cpp @@ -34,7 +34,11 @@ // in your build, in which case the latter would be used instead. For ARM64 // builds, this would also automatically enable NEON vectorization. #define XXH_INLINE_ALL +#if LL_USESYSTEMLIBS +#include +#else #include "xxhash/xxhash.h" +#endif #include "hbxxh.h" -- cgit v1.2.3 From 40cd23e1aebdf0d1e7f7295f24970af25bc18983 Mon Sep 17 00:00:00 2001 From: Erik Kundiman Date: Wed, 12 Jul 2023 18:59:35 +0800 Subject: stricmp needs to be defined on FreeBSD too --- indra/llcommon/llpreprocessor.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/llcommon') diff --git a/indra/llcommon/llpreprocessor.h b/indra/llcommon/llpreprocessor.h index dc586b0008..5df5dd8302 100644 --- a/indra/llcommon/llpreprocessor.h +++ b/indra/llcommon/llpreprocessor.h @@ -80,7 +80,7 @@ #endif // Deal with minor differences on Unixy OSes. -#if LL_DARWIN || LL_LINUX +#if LL_DARWIN || LL_LINUX || LL_FREEBSD // Different name, same functionality. #define stricmp strcasecmp #define strnicmp strncasecmp -- cgit v1.2.3 From 0f9aee9e992c34dccdb012a554a013d94437ebc5 Mon Sep 17 00:00:00 2001 From: Erik Kundiman Date: Wed, 12 Jul 2023 19:02:48 +0800 Subject: Undefine Status on FreeBSD too Otherwise we'd get this. error: declaration of anonymous struct must be a definition struct Status ^ indra/llcommon/llprocess.h:284:2: warning: declaration does not declare anything [-Wmissing-declarations] --- indra/llcommon/llprocess.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/llcommon') diff --git a/indra/llcommon/llprocess.h b/indra/llcommon/llprocess.h index e3386ad88e..9555df9bba 100644 --- a/indra/llcommon/llprocess.h +++ b/indra/llcommon/llprocess.h @@ -40,7 +40,7 @@ #if LL_WINDOWS #include "llwin32headerslean.h" // for HANDLE -#elif LL_LINUX +#elif LL_LINUX || LL_FREEBSD #if defined(Status) #undef Status #endif -- cgit v1.2.3 From 5bbf332b1b9dd1482fd203668ed12b18a5981783 Mon Sep 17 00:00:00 2001 From: Erik Kundiman Date: Fri, 21 Jul 2023 22:16:30 +0800 Subject: Fix FreeBSD login problem by checking endianness Even though the account was logged in, it would get stuck at getting region handshake. The problem was because the viewer wasn't getting the acknowledgement to the successfully sent UseCircuitCode message. I compared the message data, and it differed (from Linux) on the byte order of the Code variable (the SessionID & agent ID were right). The bytes sent to the network weren't reversed (and I was on an Intel processor). --- indra/llcommon/llpreprocessor.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'indra/llcommon') diff --git a/indra/llcommon/llpreprocessor.h b/indra/llcommon/llpreprocessor.h index 5df5dd8302..3c05fd32da 100644 --- a/indra/llcommon/llpreprocessor.h +++ b/indra/llcommon/llpreprocessor.h @@ -32,9 +32,11 @@ #ifdef LL_LINUX #define __ENABLE_WSTRING #include +#elif defined(LL_FREEBSD) +#include #endif // LL_LINUX -#if (defined(LL_WINDOWS) || (defined(LL_LINUX) && (__BYTE_ORDER == __LITTLE_ENDIAN)) || (defined(LL_DARWIN) && defined(__LITTLE_ENDIAN__))) +#if (defined(LL_WINDOWS) || (defined(LL_LINUX) && (__BYTE_ORDER == __LITTLE_ENDIAN)) || (defined(LL_DARWIN) && defined(__LITTLE_ENDIAN__)) || (defined(LL_FREEBSD) && (_BYTE_ORDER == _LITTLE_ENDIAN))) #define LL_LITTLE_ENDIAN 1 #else #define LL_BIG_ENDIAN 1 -- cgit v1.2.3 From d74367b40d3a2680bbc371b72e294419093e1d83 Mon Sep 17 00:00:00 2001 From: Erik Kundiman Date: Sat, 29 Jul 2023 20:51:40 +0800 Subject: stringop truncation warnings aren't errors on GCC --- indra/llcommon/CMakeLists.txt | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'indra/llcommon') diff --git a/indra/llcommon/CMakeLists.txt b/indra/llcommon/CMakeLists.txt index e5a3e5e0c7..758d746d54 100644 --- a/indra/llcommon/CMakeLists.txt +++ b/indra/llcommon/CMakeLists.txt @@ -283,6 +283,10 @@ if (USE_AUTOBUILD_3P OR USE_CONAN) add_dependencies(llcommon stage_third_party_libs) else () target_compile_options(${PROJECT_NAME} PUBLIC -Wno-deprecated-declarations) + if (CMAKE_CXX_COMPILER_ID MATCHES "GNU") + set_source_files_properties(llsdutil.cpp PROPERTIES + COMPILE_FLAGS -Wno-stringop-truncation) + endif() endif () if (LL_TESTS) -- cgit v1.2.3 From 665a55a1a232877ccb499dbfd17806f438385e82 Mon Sep 17 00:00:00 2001 From: Erik Kundiman Date: Sat, 29 Jul 2023 21:07:13 +0800 Subject: The Linden libraries can be installed now Useful when installed as shared libraries, so other viewer executables can share these libraries. --- indra/llcommon/CMakeLists.txt | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'indra/llcommon') diff --git a/indra/llcommon/CMakeLists.txt b/indra/llcommon/CMakeLists.txt index 758d746d54..ed7ac8deb7 100644 --- a/indra/llcommon/CMakeLists.txt +++ b/indra/llcommon/CMakeLists.txt @@ -158,6 +158,7 @@ set(llcommon_HEADER_FILES lleventdispatcher.h lleventfilter.h llevents.h + lleventtimer.h lleventemitter.h llexception.h llfasttimer.h @@ -181,12 +182,14 @@ set(llcommon_HEADER_FILES llliveappconfig.h lllivefile.h llmainthreadtask.h + llmake.h llmd5.h llmemory.h llmemorystream.h llmetrics.h llmetricperformancetester.h llmortician.h + llmutex.h llnametable.h llpointer.h llprofiler.h @@ -243,7 +246,9 @@ set(llcommon_HEADER_FILES llwin32headerslean.h llworkerthread.h hbxxh.h + is_approx_equal_fraction.h lockstatic.h + mutex.h stdtypes.h stringize.h threadpool.h @@ -289,6 +294,8 @@ else () endif() endif () +include(LibraryInstall) + if (LL_TESTS) include(LLAddBuildTest) SET(llcommon_TEST_SOURCE_FILES -- cgit v1.2.3 From fee49238c386e89e2530da86e31ff582337025a7 Mon Sep 17 00:00:00 2001 From: Erik Kundiman Date: Tue, 1 Aug 2023 09:33:43 +0800 Subject: Initialise vars so they wouldn't be errors on GCC --- indra/llcommon/llprocessor.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/llcommon') diff --git a/indra/llcommon/llprocessor.cpp b/indra/llcommon/llprocessor.cpp index b3c05f5960..cfa85ac2fd 100644 --- a/indra/llcommon/llprocessor.cpp +++ b/indra/llcommon/llprocessor.cpp @@ -961,7 +961,7 @@ private: LLPI_SET_INFO_INT(eModel, "model"); - S32 family; + S32 family = 0; if (!cpuinfo["cpu family"].empty() && LLStringUtil::convertToS32(cpuinfo["cpu family"], family)) { -- cgit v1.2.3 From eadd80cf95cc25565a3bdcea179503d21ba5ae11 Mon Sep 17 00:00:00 2001 From: Erik Kundiman Date: Thu, 17 Aug 2023 20:57:43 +0800 Subject: GLibc related code is used only on a GNU system --- indra/llcommon/llsys.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'indra/llcommon') diff --git a/indra/llcommon/llsys.cpp b/indra/llcommon/llsys.cpp index 8c4e0988fc..457ced7fae 100644 --- a/indra/llcommon/llsys.cpp +++ b/indra/llcommon/llsys.cpp @@ -82,7 +82,9 @@ using namespace llsd; # include # include const char MEMINFO_FILE[] = "/proc/meminfo"; +#ifdef __GNU__ # include +#endif #elif LL_FREEBSD # include # include @@ -353,6 +355,7 @@ LLOSInfo::LLOSInfo() : boost::regex os_version_parse(OS_VERSION_MATCH_EXPRESSION); boost::smatch matched; +#ifdef __GNU__ std::string glibc_version(gnu_get_libc_version()); if ( ll_regex_match(glibc_version, matched, os_version_parse) ) { @@ -411,6 +414,7 @@ LLOSInfo::LLOSInfo() : { LL_WARNS("AppInit") << "glibc version '" << glibc_version << "' cannot be parsed to three numbers; using all zeros" << LL_ENDL; } +#endif // __GNU__ #else -- cgit v1.2.3 From 84b72f12d42e08fe989752ce36e1972bb11c8d70 Mon Sep 17 00:00:00 2001 From: Erik Kundiman Date: Thu, 17 Aug 2023 21:01:51 +0800 Subject: Neon is used as an alternative to SSE2 on Arm systems. --- indra/llcommon/llmemory.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'indra/llcommon') diff --git a/indra/llcommon/llmemory.h b/indra/llcommon/llmemory.h index b67a8c9bc0..dd9867c9b3 100644 --- a/indra/llcommon/llmemory.h +++ b/indra/llcommon/llmemory.h @@ -71,7 +71,11 @@ LL_COMMON_API void ll_assert_aligned_func(uintptr_t ptr,U32 alignment); #define ll_assert_aligned(ptr,alignment) #endif +#if defined(__i386__) || defined(__x86_64__) #include +#else +#include +#endif template T* LL_NEXT_ALIGNED_ADDRESS(T* address) { -- cgit v1.2.3 From 6b26b3cf7eceda2c3fdebda268bbb900a4b57ffb Mon Sep 17 00:00:00 2001 From: Erik Kundiman Date: Mon, 21 Aug 2023 17:52:51 +0800 Subject: Exclude net/route.h on Darwin since it doesn't seem to have any effect, and it would only get in the way on other Darwin platforms. --- indra/llcommon/lluuid.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/llcommon') diff --git a/indra/llcommon/lluuid.cpp b/indra/llcommon/lluuid.cpp index 3b575c914c..37aee13c42 100644 --- a/indra/llcommon/lluuid.cpp +++ b/indra/llcommon/lluuid.cpp @@ -522,7 +522,7 @@ S32 LLUUID::getNodeID(unsigned char *node_id) #include #include #include -#include +//#include #include // static -- cgit v1.2.3 From 2a9bc5536330c169d43053fc7cad6311ec62c538 Mon Sep 17 00:00:00 2001 From: Erik Kundiman Date: Mon, 21 Aug 2023 17:55:19 +0800 Subject: Non x86 Darwin can use Linux's non x86 CPU clock --- indra/llcommon/llfasttimer.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/llcommon') diff --git a/indra/llcommon/llfasttimer.h b/indra/llcommon/llfasttimer.h index 53f936db34..9a5789d719 100644 --- a/indra/llcommon/llfasttimer.h +++ b/indra/llcommon/llfasttimer.h @@ -128,7 +128,7 @@ public: #endif -#if (LL_LINUX) && !(defined(__i386__) || defined(__amd64__)) +#if (LL_LINUX || LL_DARWIN) && !(defined(__i386__) || defined(__amd64__)) // // Linux implementation of CPU clock - non-x86. // This is accurate but SLOW! Only use out of desperation. -- cgit v1.2.3 From c73ba11e5fa23e346991aabb17ad72c1d40a0e56 Mon Sep 17 00:00:00 2001 From: Erik Kundiman Date: Sun, 27 Aug 2023 11:14:59 +0800 Subject: Supress warnings so GCC can finish shared libs --- indra/llcommon/CMakeLists.txt | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'indra/llcommon') diff --git a/indra/llcommon/CMakeLists.txt b/indra/llcommon/CMakeLists.txt index ed7ac8deb7..b1dc65ffc5 100644 --- a/indra/llcommon/CMakeLists.txt +++ b/indra/llcommon/CMakeLists.txt @@ -289,8 +289,12 @@ add_dependencies(llcommon stage_third_party_libs) else () target_compile_options(${PROJECT_NAME} PUBLIC -Wno-deprecated-declarations) if (CMAKE_CXX_COMPILER_ID MATCHES "GNU") - set_source_files_properties(llsdutil.cpp PROPERTIES - COMPILE_FLAGS -Wno-stringop-truncation) + set_source_files_properties( + llapp.cpp + llsdutil.cpp + PROPERTIES COMPILE_FLAGS -Wno-stringop-truncation) + set_source_files_properties(llevent.cpp PROPERTIES + COMPILE_FLAGS -Wno-nonnull) endif() endif () -- cgit v1.2.3