Skip to content

Commit e25fd6a

Browse files
committed
Add patches for v5.0.1
1 parent 4cbb379 commit e25fd6a

4 files changed

Lines changed: 177 additions & 0 deletions
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
From 3165341c655dab339f5681d47c71e78e99a0989d Mon Sep 17 00:00:00 2001
2+
From: lfdevs <109842948+lfdevs@users.noreply.github.com>
3+
Date: Thu, 29 Jan 2026 16:15:43 +0800
4+
Subject: [PATCH] Deps: Linux: Fix libffi build error on GCC 14
5+
6+
The patch is from: https://github.com/libffi/libffi/pull/764
7+
---
8+
build_files/build_environment/cmake/ffi.cmake | 4 +++
9+
.../patches/ffi_gcc14_fix.diff | 30 +++++++++++++++++++
10+
2 files changed, 34 insertions(+)
11+
create mode 100644 build_files/build_environment/patches/ffi_gcc14_fix.diff
12+
13+
diff --git a/build_files/build_environment/cmake/ffi.cmake b/build_files/build_environment/cmake/ffi.cmake
14+
index 9ca50c4a..945533d4 100644
15+
--- a/build_files/build_environment/cmake/ffi.cmake
16+
+++ b/build_files/build_environment/cmake/ffi.cmake
17+
@@ -29,6 +29,10 @@ ExternalProject_Add(external_ffi
18+
# Fix compilation errors on Apple Clang >= 17, remove when FFI is updated beyond 3.4.7, see PR #136934 for details.
19+
${BUILD_DIR}/ffi/src/external_ffi <
20+
${PATCH_DIR}/ffi_apple_clang_17.diff
21+
+ COMMAND ${PATCH_CMD} -p 1 -d
22+
+ # Fix compilation errors on GCC >= 14, remove when FFI is updated beyond 3.4.6. The patch is from https://github.com/libffi/libffi/pull/764
23+
+ ${BUILD_DIR}/ffi/src/external_ffi <
24+
+ ${PATCH_DIR}/ffi_gcc14_fix.diff
25+
26+
INSTALL_DIR ${LIBDIR}/ffi
27+
)
28+
diff --git a/build_files/build_environment/patches/ffi_gcc14_fix.diff b/build_files/build_environment/patches/ffi_gcc14_fix.diff
29+
new file mode 100644
30+
index 00000000..d5c83b79
31+
--- /dev/null
32+
+++ b/build_files/build_environment/patches/ffi_gcc14_fix.diff
33+
@@ -0,0 +1,30 @@
34+
+diff --git a/include/ffi_common.h b/include/ffi_common.h
35+
+index 2bd31b03d..c53a79493 100644
36+
+--- a/include/ffi_common.h
37+
++++ b/include/ffi_common.h
38+
+@@ -128,6 +128,10 @@ void *ffi_data_to_code_pointer (void *data) FFI_HIDDEN;
39+
+ static trampoline. */
40+
+ int ffi_tramp_is_present (void *closure) FFI_HIDDEN;
41+
+
42+
++/* Return a file descriptor of a temporary zero-sized file in a
43+
++ writable and executable filesystem. */
44+
++int open_temp_exec_file(void) FFI_HIDDEN;
45+
++
46+
+ /* Extended cif, used in callback from assembly routine */
47+
+ typedef struct
48+
+ {
49+
+diff --git a/src/tramp.c b/src/tramp.c
50+
+index b9d273a1a..c3f4c9933 100644
51+
+--- a/src/tramp.c
52+
++++ b/src/tramp.c
53+
+@@ -39,6 +39,10 @@
54+
+ #ifdef __linux__
55+
+ #define _GNU_SOURCE 1
56+
+ #endif
57+
++
58+
++#include <ffi.h>
59+
++#include <ffi_common.h>
60+
++
61+
+ #include <stdio.h>
62+
+ #include <unistd.h>
63+
+ #include <stdlib.h>
64+
--
65+
2.43.7
66+
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
From 9479e631027baaf6fd9d64da3348b606389e88d7 Mon Sep 17 00:00:00 2001
2+
From: lfdevs <109842948+lfdevs@users.noreply.github.com>
3+
Date: Thu, 29 Jan 2026 19:37:51 +0800
4+
Subject: [PATCH] Deps: Linux: Fix flex build error on GCC 14
5+
6+
Modify the flex build configuration script to not use the reallocarray function, allowing it to automatically fall back to using standard malloc/realloc to avoid segmentation faults.
7+
---
8+
build_files/build_environment/cmake/flex.cmake | 2 +-
9+
1 file changed, 1 insertion(+), 1 deletion(-)
10+
11+
diff --git a/build_files/build_environment/cmake/flex.cmake b/build_files/build_environment/cmake/flex.cmake
12+
index 6c55206e..67eb7b5d 100644
13+
--- a/build_files/build_environment/cmake/flex.cmake
14+
+++ b/build_files/build_environment/cmake/flex.cmake
15+
@@ -18,7 +18,7 @@ ExternalProject_Add(external_flex
16+
17+
CONFIGURE_COMMAND ${CONFIGURE_ENV} &&
18+
cd ${BUILD_DIR}/flex/src/external_flex/ &&
19+
- ${_autoconf_cmd_optional} ${CONFIGURE_COMMAND} --prefix=${LIBDIR}/flex
20+
+ ${_autoconf_cmd_optional} ${CONFIGURE_COMMAND} --prefix=${LIBDIR}/flex ac_cv_func_reallocarray=no
21+
22+
BUILD_COMMAND ${CONFIGURE_ENV} &&
23+
cd ${BUILD_DIR}/flex/src/external_flex/ &&
24+
--
25+
2.43.7
26+
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
From 76ebdff4d379793647de5ebb7b0d9cb6be3c7c79 Mon Sep 17 00:00:00 2001
2+
From: lfdevs <109842948+lfdevs@users.noreply.github.com>
3+
Date: Fri, 30 Jan 2026 00:05:11 +0800
4+
Subject: [PATCH] Deps: Linux arm64: Fix usd build error
5+
6+
Restrict Valgrind x86 assembly code to compile only on the x86_64 platform
7+
---
8+
build_files/build_environment/cmake/usd.cmake | 3 +++
9+
1 file changed, 3 insertions(+)
10+
11+
diff --git a/build_files/build_environment/cmake/usd.cmake b/build_files/build_environment/cmake/usd.cmake
12+
index df471c94..0c371ee5 100644
13+
--- a/build_files/build_environment/cmake/usd.cmake
14+
+++ b/build_files/build_environment/cmake/usd.cmake
15+
@@ -152,6 +152,9 @@ ExternalProject_Add(external_usd
16+
${PATCH_CMD} -p 1 -d
17+
${BUILD_DIR}/usd/src/external_usd <
18+
${PATCH_DIR}/usd_storm_vulkan.diff
19+
+ # Fix ARM64 build error: Restrict Valgrind x86 assembly code to compile only on the x86_64 platform
20+
+ COMMAND sed -i "s/defined(ARCH_OS_LINUX)/defined(ARCH_OS_LINUX) \\&\\& defined(__x86_64__)/"
21+
+ ${BUILD_DIR}/usd/src/external_usd/pxr/exec/vdf/executorDataVector.cpp
22+
CMAKE_ARGS
23+
-DCMAKE_INSTALL_PREFIX=${LIBDIR}/usd
24+
-Wno-dev
25+
--
26+
2.43.7
27+
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
From 23cfba0c9696010e5986f0c9fbc3622670457881 Mon Sep 17 00:00:00 2001
2+
From: lfdevs <109842948+lfdevs@users.noreply.github.com>
3+
Date: Fri, 30 Jan 2026 00:25:32 +0800
4+
Subject: [PATCH] Deps: Linux arm64: Exclude ROCm installation with an
5+
architecture check
6+
7+
Skip ROCm setup on aarch64, as ROCm is not supported on ARM64 now.
8+
---
9+
.../linux/linux_rocky8_setup.sh | 21 +++++++++++--------
10+
1 file changed, 12 insertions(+), 9 deletions(-)
11+
12+
diff --git a/build_files/build_environment/linux/linux_rocky8_setup.sh b/build_files/build_environment/linux/linux_rocky8_setup.sh
13+
index eae46fc0..7ff95c61 100644
14+
--- a/build_files/build_environment/linux/linux_rocky8_setup.sh
15+
+++ b/build_files/build_environment/linux/linux_rocky8_setup.sh
16+
@@ -200,11 +200,13 @@ yum -y install jack-audio-connection-kit-devel
17+
# - "Register kernel-mode driver".
18+
# - "Install kernel driver".
19+
20+
-# Register ROCm packages
21+
-sudo rpm --import https://repo.radeon.com/rocm/rocm.gpg.key
22+
-rm -f /etc/yum.repos.d/amdgpu-6.4.3.repo
23+
-rm -f /etc/yum.repos.d/rocm-6.4.3.repo
24+
-tee --append /etc/yum.repos.d/amdgpu-6.4.3.repo <<EOF
25+
+# Skip ROCm setup on aarch64, as ROCm is not supported on ARM64 now.
26+
+if [ "$(uname -i)" != "aarch64" ]; then
27+
+ # Register ROCm packages
28+
+ sudo rpm --import https://repo.radeon.com/rocm/rocm.gpg.key
29+
+ rm -f /etc/yum.repos.d/amdgpu-6.4.3.repo
30+
+ rm -f /etc/yum.repos.d/rocm-6.4.3.repo
31+
+ tee --append /etc/yum.repos.d/amdgpu-6.4.3.repo <<EOF
32+
[amdgpu-6.4.3]
33+
name=amdgpu-6.4.3
34+
baseurl=https://repo.radeon.com/amdgpu/6.4.3/el/8.10/main/x86_64/
35+
@@ -213,7 +215,7 @@ priority=50
36+
gpgcheck=1
37+
gpgkey=https://repo.radeon.com/rocm/rocm.gpg.key
38+
EOF
39+
-tee --append /etc/yum.repos.d/rocm-6.4.3.repo <<EOF
40+
+ tee --append /etc/yum.repos.d/rocm-6.4.3.repo <<EOF
41+
[ROCm-6.4.3]
42+
name=ROCm-6.4.3
43+
baseurl=https://repo.radeon.com/rocm/el8/6.4.3/main
44+
@@ -222,6 +224,7 @@ gpgcheck=1
45+
exclude=rock-dkms
46+
gpgkey=https://repo.radeon.com/rocm/rocm.gpg.key
47+
EOF
48+
-yum -y update
49+
-sudo yum install -y hipcc6.4.3 hip-devel6.4.3 rocm-llvm6.4.3 rocm-core6.4.3 rocm-device-libs6.4.3
50+
-sudo update-alternatives --set rocm /opt/rocm-6.4.3
51+
+ yum -y update
52+
+ sudo yum install -y hipcc6.4.3 hip-devel6.4.3 rocm-llvm6.4.3 rocm-core6.4.3 rocm-device-libs6.4.3
53+
+ sudo update-alternatives --set rocm /opt/rocm-6.4.3
54+
+fi
55+
\ No newline at end of file
56+
--
57+
2.43.7
58+

0 commit comments

Comments
 (0)