From 3e12a97a7f0dfa951c3997dd2117d2418fe21ce6 Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Tue, 28 Sep 2021 16:40:33 -0400 Subject: SL-16040: Honor autobuild_{configure,build}_parameters variables. The generic build.sh script honors these environment variables to specify parameters to the autobuild configure and autobuild build steps, respectively. Support them in the viewer-specific build.sh too. In the generic build.sh, autobuild_configure_parameters allows specifying command-line switches either for autobuild or, following --, for the underlying tool (in our case, CMake). In order to support that variable the same way here, we insert -- (as before) when autobuild_configure_parameters is unset or empty, since the rest of the switches *we* specify are for CMake. That means that, as with the generic build.sh, a non-empty autobuild_configure_parameters override must precede any switches intended for CMake with the -- separator. --- build.sh | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/build.sh b/build.sh index 96bcff0e8e..3291039856 100755 --- a/build.sh +++ b/build.sh @@ -132,7 +132,11 @@ pre_build() fi set -x - "$autobuild" configure --quiet -c $variant -- \ + # honor autobuild_configure_parameters same as sling-buildscripts + eval_autobuild_configure_parameters=$(eval $(echo echo $autobuild_configure_parameters)) + + "$autobuild" configure --quiet -c $variant \ + ${eval_autobuild_configure_parameters:---} \ -DPACKAGE:BOOL=ON \ -DHAVOK:BOOL="$HAVOK" \ -DRELEASE_CRASH_REPORTING:BOOL="$RELEASE_CRASH_REPORTING" \ @@ -182,7 +186,11 @@ build() if $build_viewer then begin_section "autobuild $variant" - "$autobuild" build --no-configure -c $variant || fatal "failed building $variant" + # honor autobuild_build_parameters same as sling-buildscripts + eval_autobuild_build_parameters=$(eval $(echo echo $autobuild_build_parameters)) + "$autobuild" build --no-configure -c $variant \ + $eval_autobuild_build_parameters \ + || fatal "failed building $variant" echo true >"$build_dir"/build_ok end_section "autobuild $variant" -- cgit v1.2.3 From 548bfda290b556d3ab29cc8c2f810f4cc349c9d8 Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Tue, 28 Sep 2021 16:53:04 -0400 Subject: SL-16040: operator new() must never return nullptr. --- indra/llcommon/llcommon.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/indra/llcommon/llcommon.cpp b/indra/llcommon/llcommon.cpp index da61e7539a..92f4d569b1 100644 --- a/indra/llcommon/llcommon.cpp +++ b/indra/llcommon/llcommon.cpp @@ -34,14 +34,13 @@ #include "llcleanup.h" #if (TRACY_ENABLE) -// Override new/delet for tracy memory profiling +// Override new/delete for tracy memory profiling void *operator new(size_t size) { auto ptr = (malloc) (size); if (!ptr) { throw std::bad_alloc(); - return nullptr; } TracyAlloc(ptr, size); return ptr; -- cgit v1.2.3 From db86ec9176dcbfabe5fddb3603da4132443f8b7f Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Tue, 28 Sep 2021 22:09:02 -0400 Subject: SL-16040: _aligned_malloc() and _aligned_free() are Microsoft only. Fortunately we already have platform-independent wrappers in llmemory.h. --- indra/llcommon/llcommon.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/indra/llcommon/llcommon.cpp b/indra/llcommon/llcommon.cpp index 92f4d569b1..5d4a623bf6 100644 --- a/indra/llcommon/llcommon.cpp +++ b/indra/llcommon/llcommon.cpp @@ -61,7 +61,7 @@ void operator delete(void *ptr) noexcept void *tracy_aligned_malloc(size_t size, size_t alignment) { - auto ptr = (_aligned_malloc) (size, alignment); + auto ptr = ll_aligned_malloc_fallback(size, alignment); if (ptr) TracyAlloc(ptr, size); return ptr; } @@ -69,7 +69,7 @@ void *tracy_aligned_malloc(size_t size, size_t alignment) void tracy_aligned_free(void *memblock) { TracyFree(memblock); - (_aligned_free)(memblock); + ll_aligned_free_fallback(memblock); } #endif -- cgit v1.2.3