Skip to contentSkip to conversation

rust: Fix build with clang/musl for aarch64

PATCH New Khem Raj 1 participant 2 messages May 22, 2025

lore
Share & tools
lore

Khem Raj

author
#0 lore raw

PATCH 1/1 rust: Fix build with clang/musl for aarch64

---
 ...bunwind-cross-architecture-unwinding.patch | 31 +++++++++++++++++++
 meta/recipes-devtools/rust/rust-source.inc    |  1 +
 2 files changed, 32 insertions(+)
 create mode 100644 meta/recipes-devtools/rust/files/0001-Disable-libunwind-cross-architecture-unwinding.patch
meta/recipes-devtools/rust/files/0001-Disable-libunwind-cross-architecture-unwinding.patch new file +31 -0
new file mode 100644
index 00000000000..f21c9d6c08b
@@ -0,0 +1,31 @@
+From ecc0a33b49d46a657ddf2ecd2c6ebb0b95eead45 Mon Sep 17 00:00:00 2001
+From: Khem Raj <[email protected]>
+Date: Wed, 21 May 2025 18:47:09 -0700
+Subject: [PATCH] Disable libunwind cross-architecture unwinding
+
+Building with _LIBUNWIND_IS_NATIVE_ONLY disables code for cross-architecture unwinding
+It also enables some additional code that handles PAC-specific unwind info
+it helps compiling with the -mbranch-protection=pac or -mbranch-protection=standard flags
+
+This fixes build with clang/musl on aarch64
+
+Upstream-Status: Submitted [https://github.com/rust-lang/rust/pull/141375]
+Signed-off-by: Khem Raj <[email protected]>
+---
+ src/bootstrap/src/core/build_steps/llvm.rs | 3 +++
+ 1 file changed, 3 insertions(+)
+
+diff --git a/src/bootstrap/src/core/build_steps/llvm.rs b/src/bootstrap/src/core/build_steps/llvm.rs
+index a3788197471..b45e6a9b2f9 100644
+--- a/src/bootstrap/src/core/build_steps/llvm.rs
++++ b/src/bootstrap/src/core/build_steps/llvm.rs
+@@ -1454,6 +1454,9 @@ fn run(self, builder: &Builder<'_>) -> Self::Output {
+                 cfg.define("_LIBUNWIND_HIDE_SYMBOLS", "1");
+                 cfg.define("_LIBUNWIND_IS_NATIVE_ONLY", "1");
+             }
++            if self.target.starts_with("aarch64") && self.target.contains("musl") {
++                cfg.define("_LIBUNWIND_IS_NATIVE_ONLY", "1");
++            }
+         }
+ 
+         cc_cfg.compiler(builder.cc(self.target));
meta/recipes-devtools/rust/rust-source.inc +1 -0
index 82d28cf09f4..6cb08b7c382 100644
@@ -9,6 +9,7 @@ SRC_URI += "https://static.rust-lang.org/dist/rustc-${RUST_VERSION}-src.tar.xz;n
             file://revert-link-std-statically-in-rustc_driver-feature.patch;patchdir=${RUSTSRC} \
             file://Zdual-proc-macros-additional-check.patch;patchdir=${RUSTSRC} \
             file://0001-libunwind-Use-gcs-instead-of-gcs-target-attribute.patch;patchdir=${RUSTSRC} \
+            file://0001-Disable-libunwind-cross-architecture-unwinding.patch;patchdir=${RUSTSRC} \
 "
 SRC_URI[rust.sha256sum] = "b1fbf809efe9f036939401e142631c201a53bcf43ec1696bd9f5290ba236a266"
 
author
#1 lore raw

PATCH 1/1 vulkan-samples: Upgrade to latest tip of trunk

Drop backports available in latest sources

---
 .../0001-framework-Include-stdint.h.patch     | 26 ----------------
 ...bal_options.cmake-removed-unused-ROO.patch | 30 -------------------
 .../vulkan/vulkan-samples_git.bb              |  4 +--
 3 files changed, 1 insertion(+), 59 deletions(-)
 delete mode 100644 meta/recipes-graphics/vulkan/vulkan-samples/0001-framework-Include-stdint.h.patch
 delete mode 100644 meta/recipes-graphics/vulkan/vulkan-samples/0003-bldsys-cmake-global_options.cmake-removed-unused-ROO.patch
meta/recipes-graphics/vulkan/vulkan-samples/0001-framework-Include-stdint.h.patch deleted +0 -26
deleted file mode 100644
index b30b0e0017f..00000000000
@@ -1,26 +0,0 @@
-From 9a187d2f54d3683636b951a10c165d949b3a1d18 Mon Sep 17 00:00:00 2001
-From: Khem Raj <[email protected]>
-Date: Sun, 23 Mar 2025 20:09:35 -0700
-Subject: [PATCH] framework: Include stdint.h
-
-Needed for uint32_t used in this header
-GCC 15 gets upset about it.
-
-Upstream-Status: Submitted [https://github.com/KhronosGroup/Vulkan-Samples/pull/1314]
-Signed-off-by: Khem Raj <[email protected]>
----
- framework/platform/configuration.h | 1 +
- 1 file changed, 1 insertion(+)
-
-diff --git a/framework/platform/configuration.h b/framework/platform/configuration.h
-index f6a9cae..c15f76f 100644
---- a/framework/platform/configuration.h
-+++ b/framework/platform/configuration.h
-@@ -18,6 +18,7 @@
- #pragma once
- 
- #include <algorithm>
-+#include <cstdint>
- #include <map>
- #include <memory>
- #include <string>
meta/recipes-graphics/vulkan/vulkan-samples/0003-bldsys-cmake-global_options.cmake-removed-unused-ROO.patch deleted +0 -30
deleted file mode 100644
index ffac2d78ce6..00000000000
@@ -1,30 +0,0 @@
-From da4ef211810bc3b0c51ea89f02c031a170fe0cb8 Mon Sep 17 00:00:00 2001
-From: Alexander Kanavin <[email protected]>
-Date: Tue, 1 Apr 2025 18:53:34 +0200
-Subject: [PATCH] bldsys/cmake/global_options.cmake: removed unused
- ROOT_PATH_SIZE define
-
-After various refactorings it is no longer used anywhere (and
-is problematic for build reproducibility, as build path sizes can
-differ between build hosts).
-
-Upstream-Status: Submitted [https://github.com/KhronosGroup/Vulkan-Samples/pull/1325]
-Signed-off-by: Alexander Kanavin <[email protected]>
----
- bldsys/cmake/global_options.cmake | 3 ---
- 1 file changed, 3 deletions(-)
-
-diff --git a/bldsys/cmake/global_options.cmake b/bldsys/cmake/global_options.cmake
-index 96c7add..67a6c5e 100644
---- a/bldsys/cmake/global_options.cmake
-+++ b/bldsys/cmake/global_options.cmake
-@@ -126,9 +126,6 @@ set(CMAKE_CXX_STANDARD 17)
- set(CMAKE_DISABLE_SOURCE_CHANGES ON)
- set(CMAKE_DISABLE_IN_SOURCE_BUILD ON)
- 
--string(LENGTH "${CMAKE_SOURCE_DIR}/" ROOT_PATH_SIZE)
--add_definitions(-DROOT_PATH_SIZE=${ROOT_PATH_SIZE})
--
- set(CMAKE_C_FLAGS_DEBUG   "-DDEBUG=0 ${CMAKE_C_FLAGS_DEBUG}")
- set(CMAKE_CXX_FLAGS_DEBUG "-DDEBUG=0 ${CMAKE_CXX_FLAGS_DEBUG}")
- 
meta/recipes-graphics/vulkan/vulkan-samples_git.bb +1 -3
index 505b6ab2f28..1caff12a5b9 100644
@@ -7,12 +7,10 @@ LIC_FILES_CHKSUM = "file://LICENSE;md5=48aa35cefb768436223a6e7f18dc2a2a"
 
 SRC_URI = "gitsm://github.com/KhronosGroup/Vulkan-Samples.git;branch=main;protocol=https;lfs=0 \
            file://0001-SPIRV-SpvBuilder.h-add-missing-cstdint-include.patch;patchdir=third_party/glslang \
-           file://0001-framework-Include-stdint.h.patch \
-           file://0003-bldsys-cmake-global_options.cmake-removed-unused-ROO.patch \
            "
 
 UPSTREAM_CHECK_COMMITS = "1"
-SRCREV = "8547ce1022a19870d3e49075b5b08ca2d11c8773"
+SRCREV = "eca122602a5d7a9f63686411dcef1b62feb36a9a"
 
 UPSTREAM_CHECK_GITTAGREGEX = "These are not the releases you're looking for"
 S = "${WORKDIR}/git"