From f342d16c6302001c790f42234d355af16d458c25 Mon Sep 17 00:00:00 2001 From: zhangxiang Date: Fri, 28 Jul 2023 15:16:15 +0800 Subject: [PATCH] add riscv64 support add riscv64 support for clang --- add-riscv-support.patch | 56 +++++++++++++++++++++++++++++++++++++++++ libmetal.spec | 9 +++++-- 2 files changed, 63 insertions(+), 2 deletions(-) create mode 100644 add-riscv-support.patch diff --git a/add-riscv-support.patch b/add-riscv-support.patch new file mode 100644 index 0000000..e03e5bc --- /dev/null +++ b/add-riscv-support.patch @@ -0,0 +1,56 @@ +diff -ur --new-file libmetal-2022.10.0/lib/processor/riscv/CMakeLists.txt libmetal-2022.10.0/lib/processor/riscv/CMakeLists.txt +--- libmetal-2022.10.0/lib/processor/riscv/CMakeLists.txt 2022-10-28 10:12:23.000000000 +0800 ++++ libmetal-2022.10.0/lib/processor/riscv/CMakeLists.txt 1970-01-01 08:00:00.000000000 +0800 +@@ -1,3 +0,0 @@ +-collect (PROJECT_LIB_HEADERS cpu.h) +- +-# vim: expandtab:ts=2:sw=2:smartindent +diff -ur --new-file libmetal-2022.10.0/lib/processor/riscv/cpu.h libmetal-2022.10.0/lib/processor/riscv/cpu.h +--- libmetal-2022.10.0/lib/processor/riscv/cpu.h 2022-10-28 10:12:23.000000000 +0800 ++++ libmetal-2022.10.0/lib/processor/riscv/cpu.h 1970-01-01 08:00:00.000000000 +0800 +@@ -1,17 +0,0 @@ +-/* +- * Copyright (c) 2018, Pinecone Inc. and Contributors. All rights reserved. +- * +- * SPDX-License-Identifier: BSD-3-Clause +- */ +- +-/* +- * @file cpu.h +- * @brief CPU specific primitives +- */ +- +-#ifndef __METAL_RISCV_CPU__H__ +-#define __METAL_RISCV_CPU__H__ +- +-#define metal_cpu_yield() +- +-#endif /* __METAL_RISCV_CPU__H__ */ +diff -ur --new-file libmetal-2022.10.0/lib/processor/riscv64/CMakeLists.txt libmetal-2022.10.0/lib/processor/riscv64/CMakeLists.txt +--- libmetal-2022.10.0/lib/processor/riscv64/CMakeLists.txt 1970-01-01 08:00:00.000000000 +0800 ++++ libmetal-2022.10.0/lib/processor/riscv64/CMakeLists.txt 2023-06-20 17:21:21.507556947 +0800 +@@ -0,0 +1,3 @@ ++collect (PROJECT_LIB_HEADERS cpu.h) ++ ++# vim: expandtab:ts=2:sw=2:smartindent +diff -ur --new-file libmetal-2022.10.0/lib/processor/riscv64/cpu.h libmetal-2022.10.0/lib/processor/riscv64/cpu.h +--- libmetal-2022.10.0/lib/processor/riscv64/cpu.h 1970-01-01 08:00:00.000000000 +0800 ++++ libmetal-2022.10.0/lib/processor/riscv64/cpu.h 2023-06-20 17:21:21.507556947 +0800 +@@ -0,0 +1,17 @@ ++/* ++ * Copyright (c) 2018, Pinecone Inc. and Contributors. All rights reserved. ++ * ++ * SPDX-License-Identifier: BSD-3-Clause ++ */ ++ ++/* ++ * @file cpu.h ++ * @brief CPU specific primitives ++ */ ++ ++#ifndef __METAL_RISCV_CPU__H__ ++#define __METAL_RISCV_CPU__H__ ++ ++#define metal_cpu_yield() ++ ++#endif /* __METAL_RISCV_CPU__H__ */ diff --git a/libmetal.spec b/libmetal.spec index 247c8e3..5aeb38f 100644 --- a/libmetal.spec +++ b/libmetal.spec @@ -1,6 +1,6 @@ Name: libmetal Version: 2022.10.0 -Release: 3 +Release: 4 Summary: An abstraction layer across user-space Linux, baremetal, and RTOS environments License: BSD @@ -8,7 +8,9 @@ URL: https://github.com/OpenAMP/libmetal/ Source0: https://github.com/OpenAMP/libmetal/archive/refs/tags/v%{version}/%{name}-%{version}.tar.gz Patch0: libmetal-add-additional-arches.patch - +%if "%toolchain"=="clang" +Patch1: add-riscv-support.patch +%endif BuildRequires: cmake BuildRequires: doxygen BuildRequires: gcc @@ -71,6 +73,9 @@ done %changelog +* Mon Jun 19 2023 zhangxiang - 2022.10.0-4 +- add riscv support + * Mon Feb 27 2023 hanzongcheng - 2022.10.0-3 - update to 2022.10.0 -- Gitee