summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorbartus2021-06-30 17:32:41 +0200
committerbartus2021-06-30 17:52:48 +0200
commitcbea1f5437d9b0fd70c5a1c651c18d1b54db4453 (patch)
tree6e3de39aad598a262a0b5dd5c6d78d010002e81e
parentf01066cdb1d2b2658b43d8b9f6e79b938bd93a90 (diff)
downloadaur-usd21.tar.gz
Update to v21.02, refactor, fix gcc11 build
-rw-r--r--.SRCINFO19
-rw-r--r--PKGBUILD22
-rw-r--r--blender.patch257
-rw-r--r--demangle-fix.patch18
-rw-r--r--gcc11.patch12
-rw-r--r--std.patch13
6 files changed, 214 insertions, 127 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 5de591978918..655854d6e009 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,6 +1,6 @@
-pkgbase = usd-qfix
+pkgbase = usd21
pkgdesc = 3D VFX pipeline interchange file format.
- pkgver = 20.05
+ pkgver = 21.02
pkgrel = 1
url = https://graphics.pixar.com/usd/docs/index.html
arch = x86_64
@@ -21,16 +21,17 @@ pkgbase = usd-qfix
depends = glew
depends = openexr
depends = opensubdiv
- provides = usd=20.05
+ provides = usd=21.02
conflicts = usd
- source = git+https://github.com/PixarAnimationStudios/USD.git#tag=v20.05
+ source = git+https://github.com/PixarAnimationStudios/USD.git#tag=v21.02
source = boost_python2.patch
source = blender.patch
- source = std.patch
+ source = gcc11.patch
+ source = demangle-fix.patch
sha256sums = SKIP
sha256sums = 2f595ce72b9fb33e6da7db97b02be11fe6262e31b83b0e59232ee8713afed97e
- sha256sums = 95a4934ae8154e1650a024b09ed3237ba7d9411ada089a4b6337cbba9312705a
- sha256sums = 5e9dfc3daa97271b959e78737079335907a3536bb8af2d74ef9b8f7529f2f8e5
-
-pkgname = usd-qfix
+ sha256sums = 0a3f545fdf1b515bdcfad9d606e53293b6d0df47e954b0064370a97b54b8d377
+ sha256sums = 663352c8932a0b48230087284f4f5c540876f6a5adab3d4d1a7ee7b3a4ad6462
+ sha256sums = 99ea5fba92842d0215e5188662a066e0cc714ed4dea9c8663cb6239f6c1afbd0
+pkgname = usd21
diff --git a/PKGBUILD b/PKGBUILD
index d6f751ab6c26..eed40c025f2b 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -5,7 +5,7 @@
[[ -v TRAVIS ]] && DISABLE_PYTHON=1
# Configuration.
-_ver="v20.05" #switch to last blender supported version, latest is "v20.08"
+_ver="v21.02" #switch to last blender supported version, latest is "v21.02"
_fragment="#tag=$_ver"
if ((DISABLE_PYTHON)); then
_CMAKE_FLAGS+=( "-DPXR_ENABLE_PYTHON_SUPPORT:BOOL=OFF" )
@@ -16,7 +16,7 @@ else
eval "makedepends+=( python2-{jinja,pyside-tools} )"
fi
-pkgname=usd-qfix
+pkgname=usd21
pkgver=${_ver#v}
pkgrel=1
pkgdesc="3D VFX pipeline interchange file format."
@@ -30,14 +30,16 @@ conflicts=("usd")
source=("git+https://github.com/PixarAnimationStudios/USD.git${_fragment}"
"boost_python2.patch"
"blender.patch"
- "std.patch")
+ "gcc11.patch"
+ "demangle-fix.patch")
sha256sums=('SKIP'
'2f595ce72b9fb33e6da7db97b02be11fe6262e31b83b0e59232ee8713afed97e'
- '95a4934ae8154e1650a024b09ed3237ba7d9411ada089a4b6337cbba9312705a'
- '5e9dfc3daa97271b959e78737079335907a3536bb8af2d74ef9b8f7529f2f8e5')
+ '0a3f545fdf1b515bdcfad9d606e53293b6d0df47e954b0064370a97b54b8d377'
+ '663352c8932a0b48230087284f4f5c540876f6a5adab3d4d1a7ee7b3a4ad6462'
+ '99ea5fba92842d0215e5188662a066e0cc714ed4dea9c8663cb6239f6c1afbd0')
prepare() {
- git -C USD apply -v "${srcdir}"/{boost_python2,blender,std}.patch
+ git -C USD apply -v "${srcdir}"/{demangle-fix,gcc11}.patch
}
#pkgver() {
@@ -47,15 +49,15 @@ prepare() {
build() {
_CMAKE_FLAGS+=(
-DCMAKE_INSTALL_PREFIX:PATH=/usr
- -DPXR_BUILD_TESTS:BOOL=OFF
- -DPXR_BUILD_MONOLITHIC:BOOL=ON # Required by blender-2.83
+ -DPXR_BUILD_TESTS=OFF
+ -DPXR_BUILD_MONOLITHIC=ON # Required by blender-2.83
-DBoost_NO_BOOST_CMAKE=ON # Fix boost overwriting boost_python27 with boost_python
-DPXR_SET_INTERNAL_NAMESPACE=usdBlender
-DBUILD_SHARED_LIBS=ON
- -DCMAKE_DEBUG_POSTFIX=_d
)
+ export CXXFLAGS+=" -DBOOST_BIND_GLOBAL_PLACEHOLDERS"
cmake -S USD -B build -G Ninja "${_CMAKE_FLAGS[@]}"
-# shellcheck disable=SC2046
+# shellcheck disable=SC2086
ninja -C build ${MAKEFLAGS:--j1}
}
diff --git a/blender.patch b/blender.patch
index fe767829a70a..dc4982ad1148 100644
--- a/blender.patch
+++ b/blender.patch
@@ -10,77 +10,6 @@ diff -x .git -ur usd.orig/cmake/defaults/Packages.cmake external_usd/cmake/defau
add_definitions(${TBB_DEFINITIONS})
# --math
-diff -x .git -ur usd.orig/pxr/base/plug/initConfig.cpp external_usd/pxr/base/plug/initConfig.cpp
---- usd.orig/pxr/base/plug/initConfig.cpp.orig 2020-06-12 17:20:07.478199779 +0200
-+++ external_usd/pxr/base/plug/initConfig.cpp 2020-06-12 17:25:28.648588552 +0200
-@@ -69,10 +69,40 @@
-
- ARCH_CONSTRUCTOR(Plug_InitConfig, 2, void)
- {
-+ /* The contents of this constructor have been moved to usd_initialise_plugin_path(...) */
-+}
-+
-+}; // end of anonymous namespace
-+
-+/**
-+ * The contents of this function used to be in the static constructor Plug_InitConfig.
-+ * This static constructor made it impossible for Blender to pass a path to the USD
-+ * library at runtime, as the constructor would run before Blender's main() function.
-+ *
-+ * This function is wrapped in a C function of the same name (defined below),
-+ * so that it can be called from Blender's main() function.
-+ *
-+ * The datafiles_usd_path path is used to point to the USD plugin path when Blender
-+ * has been installed. The fallback_usd_path path should point to the build-time
-+ * location of the USD plugin files so that Blender can be run on a development machine
-+ * without requiring an installation step.
-+ */
-+void
-+usd_initialise_plugin_path(const char *datafiles_usd_path)
-+{
- std::vector<std::string> result;
-
- std::vector<std::string> debugMessages;
-
-+ // Add Blender-specific paths. They MUST end in a slash, or symlinks will not be treated as directory.
-+ if (datafiles_usd_path != NULL && datafiles_usd_path[0] != '\0') {
-+ std::string datafiles_usd_path_str(datafiles_usd_path);
-+ if (datafiles_usd_path_str.back() != '/') {
-+ datafiles_usd_path_str += "/";
-+ }
-+ result.push_back(datafiles_usd_path_str);
-+ }
-+
- // Determine the absolute path to the Plug shared library. Any relative
- // paths specified in the plugin search path will be anchored to this
- // directory, to allow for relocatability. Note that this can fail when pxr
-@@ -114,9 +144,24 @@
- _AppendPathList(&result, installLocation, binaryPath);
- #endif // PXR_INSTALL_LOCATION
-
-- Plug_SetPaths(result, debugMessages);
--}
-+ if (!TfGetenv("PXR_PATH_DEBUG").empty()) {
-+ printf("USD Plugin paths: (%zu in total):\n", result.size());
-+ for(const std::string &path : result) {
-+ printf(" %s\n", path.c_str());
-+ }
-+ }
-
-+ Plug_SetPaths(result, debugMessages);
- }
-
- PXR_NAMESPACE_CLOSE_SCOPE
-+
-+/* Workaround to make it possible to pass a path at runtime to USD. */
-+extern "C" {
-+void
-+usd_initialise_plugin_path(
-+ const char *datafiles_usd_path)
-+{
-+ PXR_NS::usd_initialise_plugin_path(datafiles_usd_path);
-+}
-+}
diff -Naur external_usd_base/cmake/macros/Public.cmake external_usd/cmake/macros/Public.cmake
--- external_usd_base/cmake/macros/Public.cmake 2019-10-24 14:39:53 -0600
+++ external_usd/cmake/macros/Public.cmake 2020-01-11 13:33:29 -0700
@@ -97,36 +26,174 @@ diff -Naur external_usd_base/cmake/macros/Public.cmake external_usd/cmake/macros
endforeach()
foreach(lib ${PXR_OBJECT_LIBS})
set(objects "${objects};\$<TARGET_OBJECTS:${lib}>")
+diff -ru USD-20.11/pxr/base/tf/pxrLZ4/lz4.cpp external_usd/pxr/base/tf/pxrLZ4/lz4.cpp
+--- USD-20.11/pxr/base/tf/pxrLZ4/lz4.cpp 2020-10-14 19:25:19.000000000 +0100
++++ external_usd/pxr/base/tf/pxrLZ4/lz4.cpp 2021-02-09 09:28:51.496190085 +0000
+@@ -614,6 +614,15 @@
+ /*-************************************
+ * Internal Definitions used in Tests
+ **************************************/
++
++/*******************************************************************
++ * Disabled in Blender. The BLOSC library also exposes these
++ * functions, and this causes 'duplicate symbol' linker errors.
++ *
++ * This problem has been reported upstream at
++ * https://github.com/PixarAnimationStudios/USD/issues/1447
++ *
++ *******************************************************************
+ #if defined (__cplusplus)
+ extern "C" {
+ #endif
+@@ -627,6 +636,7 @@
+ #if defined (__cplusplus)
+ }
+ #endif
++********************************************************************/
+
+ /*-******************************
+ * Compression functions
+
+From 442d087962f762deeb8b6e49a0955753fcf9aeb9 Mon Sep 17 00:00:00 2001
+From: Tsahi Zidenberg <tsahee@amazon.com>
+Date: Sun, 15 Nov 2020 15:18:24 +0000
+Subject: [PATCH 1/2] stackTrace: support aarch64/linux
+
+stacktrace calls syscall directly via assembler. Create compatible
+aarch64 code.
+---
+ pxr/base/arch/stackTrace.cpp | 30 ++++++++++++++++++++++++------
+ 1 file changed, 24 insertions(+), 6 deletions(-)
-diff --git a/pxr/base/arch/align.h b/pxr/base/arch/align.h
-index f3cabf4..ebc8a69 100644
---- a/pxr/base/arch/align.h
-+++ b/pxr/base/arch/align.h
-@@ -77,7 +77,11 @@ ArchAlignMemory(void *base)
- /// The size of a CPU cache line on the current processor architecture in bytes.
- ///
- /// \hideinitializer
-+#if defined(ARCH_OS_DARWIN) && defined(ARCH_CPU_ARM)
-+#define ARCH_CACHE_LINE_SIZE 128
+diff --git a/pxr/base/arch/stackTrace.cpp b/pxr/base/arch/stackTrace.cpp
+index dcc1dfd46..c11aabeb1 100644
+--- a/pxr/base/arch/stackTrace.cpp
++++ b/pxr/base/arch/stackTrace.cpp
+@@ -583,7 +583,6 @@ nonLockingLinux__execve (const char *file,
+ char *const argv[],
+ char *const envp[])
+ {
+-#if defined(ARCH_BITS_64)
+ /*
+ * We make a direct system call here, because we can't find an
+ * execve which corresponds with the non-locking fork we call
+@@ -594,7 +593,27 @@ nonLockingLinux__execve (const char *file,
+ * hangs in a threaded app. (We use the non-locking fork to get
+ * around problems with forking when we have had memory
+ * corruption.) whew.
+- *
++ */
++
++ unsigned long result;
++
++#if defined (__aarch64__)
++ {
++ register long __file_result asm ("x0") = (long)file;
++ register char* const* __argv asm ("x1") = argv;
++ register char* const* __envp asm ("x2") = envp;
++ register long __num_execve asm ("x8") = 221;
++ __asm__ __volatile__ (
++ "svc 0"
++ : "=r" (__file_result)
++ : "r"(__num_execve), "r" (__file_result), "r" (__argv), "r" (__envp)
++ : "memory"
++ );
++ result = __file_result;
++ }
++#elif defined(ARCH_CPU_INTEL) && defined(ARCH_BITS_64)
++
++ /*
+ * %rdi, %rsi, %rdx, %rcx, %r8, %r9 are args 0-5
+ * syscall clobbers %rcx and %r11
+ *
+@@ -603,7 +622,6 @@ nonLockingLinux__execve (const char *file,
+ * constraints to gcc.
+ */
+
+- unsigned long result;
+ __asm__ __volatile__ (
+ "mov %0, %%rdi \n\t"
+ "mov %%rcx, %%rsi \n\t"
+@@ -614,6 +632,9 @@ nonLockingLinux__execve (const char *file,
+ : "0" (file), "c" (argv), "d" (envp)
+ : "memory", "cc", "r11"
+ );
+#else
- #define ARCH_CACHE_LINE_SIZE 64
++#error Unknown architecture
+#endif
- ///@}
-
-diff --git a/pxr/base/arch/math.h b/pxr/base/arch/math.h
-index 3e66c37..64a052c 100644
---- a/pxr/base/arch/math.h
-+++ b/pxr/base/arch/math.h
-@@ -42,7 +42,7 @@ PXR_NAMESPACE_OPEN_SCOPE
- /// \addtogroup group_arch_Math
- ///@{
+ if (result >= 0xfffffffffffff000) {
+ errno = -result;
+@@ -621,9 +642,6 @@ nonLockingLinux__execve (const char *file,
+ }
--#if defined (ARCH_CPU_INTEL) || defined(doxygen)
-+#if defined (ARCH_CPU_INTEL) || defined(ARCH_CPU_ARM) || defined(doxygen)
+ return result;
+-#else
+-#error Unknown architecture
+-#endif
+ }
- /// This is the smallest value e such that 1+e^2 == 1, using floats.
- /// True for all IEEE754 chipsets.
+ #endif
+From a1dffe02519bb3c6ccbbe8c6c58304da5db98995 Mon Sep 17 00:00:00 2001
+From: Tsahi Zidenberg <tsahee@amazon.com>
+Date: Sun, 15 Nov 2020 15:22:52 +0000
+Subject: [PATCH 2/2] timing: support aarch64/linux
+The aarch64 arch-timer is directly accessible to userspace via two
+registers:
+CNTVCT_EL0 - holds the current counter value
+CNTFRQ_EL0 - holds the counter frequency (in Hz)
+---
+ pxr/base/arch/timing.cpp | 6 ++++++
+ pxr/base/arch/timing.h | 6 +++++-
+ 2 files changed, 11 insertions(+), 1 deletion(-)
+diff --git a/pxr/base/arch/timing.cpp b/pxr/base/arch/timing.cpp
+index 27ad58fed..9022950c1 100644
+--- a/pxr/base/arch/timing.cpp
++++ b/pxr/base/arch/timing.cpp
+@@ -59,6 +59,11 @@ ARCH_HIDDEN
+ void
+ Arch_InitTickTimer()
+ {
++#ifdef __aarch64__
++ uint64_t counter_hz;
++ __asm __volatile("mrs %0, CNTFRQ_EL0" : "=&r" (counter_hz));
++ Arch_NanosecondsPerTick = double(1e9) / double(counter_hz);
++#else
+ // NOTE: Normally ifstream would be cleaner, but it causes crashes when
+ // used in conjunction with DSOs and the Intel Compiler.
+ FILE *in;
+@@ -135,6 +140,7 @@ Arch_InitTickTimer()
+ }
+
+ Arch_NanosecondsPerTick = double(1e9) / double(cpuHz);
++#endif
+ }
+ #elif defined(ARCH_OS_WINDOWS)
+
+diff --git a/pxr/base/arch/timing.h b/pxr/base/arch/timing.h
+index 67ec0d15f..6dc3e85a0 100644
+--- a/pxr/base/arch/timing.h
++++ b/pxr/base/arch/timing.h
+@@ -36,7 +36,7 @@
+ /// \addtogroup group_arch_SystemFunctions
+ ///@{
+
+-#if defined(ARCH_OS_LINUX)
++#if defined(ARCH_OS_LINUX) && defined(ARCH_CPU_INTEL)
+ #include <x86intrin.h>
+ #elif defined(ARCH_OS_DARWIN)
+ #include <mach/mach_time.h>
+@@ -69,6 +69,10 @@ ArchGetTickTime()
+ #elif defined(ARCH_CPU_INTEL)
+ // On Intel we'll use the rdtsc instruction.
+ return __rdtsc();
++#elif defined (__aarch64__)
++ uint64_t result;
++ __asm __volatile("mrs %0, CNTVCT_EL0" : "=&r" (result));
++ return result;
+ #else
+ #error Unknown architecture.
+ #endif
diff --git a/demangle-fix.patch b/demangle-fix.patch
new file mode 100644
index 000000000000..a59efc6164fd
--- /dev/null
+++ b/demangle-fix.patch
@@ -0,0 +1,18 @@
+--- USD-21.02/pxr/base/arch/demangle.cpp.orig 2021-01-20 09:13:57.000000000 +0900
++++ USD-21.02/pxr/base/arch/demangle.cpp 2021-02-05 16:37:27.154126908 +0900
+@@ -36,6 +36,7 @@ using std::string;
+ #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 <cxxabi.h>
+ #endif
+
+ PXR_NAMESPACE_OPEN_SCOPE
+@@ -138,7 +139,6 @@ _StripPxrInternalNamespace(string* name)
+ #endif
+
+ #if defined(_AT_LEAST_GCC_THREE_ONE_OR_CLANG)
+-#include <cxxabi.h>
+
+ /*
+ * This routine doesn't work when you get to gcc3.4.
diff --git a/gcc11.patch b/gcc11.patch
new file mode 100644
index 000000000000..57b5fb1676d6
--- /dev/null
+++ b/gcc11.patch
@@ -0,0 +1,12 @@
+diff -upr USD-21.05.orig/pxr/base/work/singularTask.h USD-21.05/pxr/base/work/singularTask.h
+--- USD-21.05.orig/pxr/base/work/singularTask.h 2021-04-13 01:09:41.000000000 +0300
++++ USD-21.05/pxr/base/work/singularTask.h 2021-06-08 23:53:13.343073026 +0300
+@@ -120,7 +120,7 @@ private:
+ // 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));
+ });
diff --git a/std.patch b/std.patch
deleted file mode 100644
index c10ce34924c1..000000000000
--- a/std.patch
+++ /dev/null
@@ -1,13 +0,0 @@
-diff --git a/pxr/usd/ar/packageUtils.cpp b/pxr/usd/ar/packageUtils.cpp
-index d497587b3..ed3df295f 100644
---- a/pxr/usd/ar/packageUtils.cpp
-+++ b/pxr/usd/ar/packageUtils.cpp
-@@ -29,6 +29,8 @@
- #include "pxr/base/tf/pathUtils.h"
- #include "pxr/base/tf/stringUtils.h"
-
-+#include <algorithm>
-+
- PXR_NAMESPACE_OPEN_SCOPE
-
- namespace