From d88c1c55da398c1e9935cffe412f079a5e6c7a81 Mon Sep 17 00:00:00 2001 From: Kristofer Jonsson Date: Tue, 14 Feb 2023 13:52:59 +0100 Subject: Fix compilation warnings for OpenAMP Add support for ArmClang including the correct errno.h. Silence warnings about unsupported pragma. Change-Id: Ieb88938399679ddc39f7b8c390e41afef2b46606 --- .gitignore | 1 - openamp/CMakeLists.txt | 10 +++++++--- openamp/src/libmetal/errno.h | 23 +++++++++++++++++++++++ 3 files changed, 30 insertions(+), 4 deletions(-) create mode 100644 openamp/src/libmetal/errno.h diff --git a/.gitignore b/.gitignore index c58c1f4..7c5676a 100644 --- a/.gitignore +++ b/.gitignore @@ -2,7 +2,6 @@ /core_driver /cmsis /cmsis-nn -/openamp /rtos/freertos /rtos/threadx /rtos/zephyr diff --git a/openamp/CMakeLists.txt b/openamp/CMakeLists.txt index 801c0c8..62abbdd 100644 --- a/openamp/CMakeLists.txt +++ b/openamp/CMakeLists.txt @@ -30,10 +30,8 @@ function(build_openamp PROJECT_SYSTEM) src/system/${PROJECT_SYSTEM}/${PROJECT_MACHINE}/*.c # OpenAMP -# openamp/lib/proxy/*.c openamp/lib/remoteproc/*.c openamp/lib/rpmsg/*.c -# openamp/lib/service/*.c openamp/lib/virtio/*.c) add_library(openamp-${PROJECT_SYSTEM} STATIC @@ -50,19 +48,25 @@ function(build_openamp PROJECT_SYSTEM) OPENAMP_VERSION_MINOR=0 OPENAMP_VERSION_PATCH=0 OPENAMP_VERSION=0 - $<$:__ICCARM__> METAL_INTERNAL) target_link_libraries(openamp-${PROJECT_SYSTEM} PRIVATE cmsis_device $<$:freertos_kernel>) + target_compile_options(openamp-${PROJECT_SYSTEM} PRIVATE + -Wno-unknown-pragmas + ) + # Generate libmetal headers file(GLOB_RECURSE HDRS RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}/libmetal/lib" "libmetal/lib/*.h") foreach(HDR ${HDRS}) configure_file("libmetal/lib/${HDR}" "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_SYSTEM}/metal/${HDR}") endforeach() + + # Override errno.h adding support for ArmClang + configure_file("src/libmetal/errno.h" "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_SYSTEM}/metal/errno.h") endfunction() build_openamp(generic) diff --git a/openamp/src/libmetal/errno.h b/openamp/src/libmetal/errno.h new file mode 100644 index 0000000..c933a0c --- /dev/null +++ b/openamp/src/libmetal/errno.h @@ -0,0 +1,23 @@ +/* + * Copyright (c) 2020 STMicroelectronnics. All rights reserved. + * SPDX-FileCopyrightText: Copyright 2023 Arm Limited and/or its affiliates + * SPDX-License-Identifier: BSD-3-Clause + */ + +/* + * @file metal/errno.h + * @brief error specific primitives for libmetal. + */ + +#ifndef __METAL_ERRNO__H__ +#define __METAL_ERRNO__H__ + +#if defined(__ICCARM__) +# include +#elif defined(__CC_ARM) || defined (__ARMCC_VERSION) +# include +#else +# include +#endif + +#endif /* __METAL_ERRNO__H__ */ -- cgit v1.2.1