From 6c33a0f6d6d2e8cd091fd089d2458a310dc5ca52 Mon Sep 17 00:00:00 2001 From: Bastien Montagne Date: Mon, 20 Dec 2021 16:11:20 +0100 Subject: Update our USD 21.02 patch to support gcc-11 There are two issues in USD code that break building it with gcc-11, one (in `demangle.cpp`) was already fixed upstream, the other (in `singularTask.h`) is still pending (reported upstream, see https://github.com/PixarAnimationStudios/USD/issues/1721). CC #platforms_builds_tests_devices project. --- build_files/build_environment/patches/usd.diff | 35 ++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) (limited to 'build_files') diff --git a/build_files/build_environment/patches/usd.diff b/build_files/build_environment/patches/usd.diff index dc4982ad114..8ea1e2054c1 100644 --- a/build_files/build_environment/patches/usd.diff +++ b/build_files/build_environment/patches/usd.diff @@ -197,3 +197,38 @@ index 67ec0d15f..6dc3e85a0 100644 #else #error Unknown architecture. #endif + +diff --git a/pxr/base/arch/demangle.cpp b/pxr/base/arch/demangle.cpp +index 67ec0d15f..6dc3e85a0 100644 +--- a/pxr/base/arch/demangle.cpp ++++ b/pxr/base/arch/demangle.cpp +@@ -36,6 +36,7 @@ + #if (ARCH_COMPILER_GCC_MAJOR == 3 && ARCH_COMPILER_GCC_MINOR >= 1) || \ + ARCH_COMPILER_GCC_MAJOR > 3 || defined(ARCH_COMPILER_CLANG) + #define _AT_LEAST_GCC_THREE_ONE_OR_CLANG ++#include + #endif + + PXR_NAMESPACE_OPEN_SCOPE +@@ -138,7 +139,6 @@ + #endif + + #if defined(_AT_LEAST_GCC_THREE_ONE_OR_CLANG) +-#include + + /* + * This routine doesn't work when you get to gcc3.4. + +diff --git a/pxr/base/work/singularTask.h b/pxr/base/work/singularTask.h +index 67ec0d15f..6dc3e85a0 100644 +--- a/pxr/base/work/singularTask.h ++++ b/pxr/base/work/singularTask.h +@@ -120,7 +120,7 @@ + // case we go again to ensure the task can do whatever it + // was awakened to do. Once we successfully take the count + // to zero, we stop. +- size_t old = count; ++ std::size_t old = count; + do { _fn(); } while ( + !count.compare_exchange_strong(old, 0)); + }); -- cgit v1.2.3