diff options
author | Kristofer Jonsson <kristofer.jonsson@arm.com> | 2023-02-14 13:52:59 +0100 |
---|---|---|
committer | Kristofer Jonsson <kristofer.jonsson@arm.com> | 2023-02-15 14:07:27 +0100 |
commit | d88c1c55da398c1e9935cffe412f079a5e6c7a81 (patch) | |
tree | e28c4afc8079bcc667c872e2871cfe7ea48a00dc /openamp | |
parent | 02eef5bbaac09cfdcf498324663c10b737677ac1 (diff) | |
download | ethos-u-core-software-d88c1c55da398c1e9935cffe412f079a5e6c7a81.tar.gz |
Add support for ArmClang including the correct errno.h.
Silence warnings about unsupported pragma.
Change-Id: Ieb88938399679ddc39f7b8c390e41afef2b46606
Diffstat (limited to 'openamp')
-rw-r--r-- | openamp/CMakeLists.txt | 10 | ||||
-rw-r--r-- | openamp/src/libmetal/errno.h | 23 |
2 files changed, 30 insertions, 3 deletions
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 - $<$<STREQUAL:${CMAKE_CXX_COMPILER_ID},ARMClang>:__ICCARM__> METAL_INTERNAL) target_link_libraries(openamp-${PROJECT_SYSTEM} PRIVATE cmsis_device $<$<STREQUAL:${PROJECT_SYSTEM},freertos>: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 <open-source-office@arm.com> + * 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 <metal/compiler/iar/errno.h> +#elif defined(__CC_ARM) || defined (__ARMCC_VERSION) +# include <metal/compiler/armcc/errno.h> +#else +# include <errno.h> +#endif + +#endif /* __METAL_ERRNO__H__ */ |