armclang: adding toolchain/armclang.h header

The armclang.h includes the toolchain/llvm.h header.

Also it redifines the __GENERIC_SECTION and Z_GENERIC_SECTION so that
they includes the `used` attribute which is needed by armlink.

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
This commit is contained in:
Torsten Rasmussen 2021-04-20 13:55:43 +02:00 committed by Anas Nashif
commit ce8f8c9f17
2 changed files with 25 additions and 0 deletions

View file

@ -42,6 +42,8 @@
#include <toolchain/xcc.h>
#elif defined(__CCAC__)
#include <toolchain/mwdt.h>
#elif defined(__ARMCOMPILER_VERSION)
#include <toolchain/armclang.h>
#elif defined(__llvm__)
#include <toolchain/llvm.h>
#elif defined(__GNUC__) || (defined(_LINKER) && defined(__GCC_LINKER_CMD__))

View file

@ -0,0 +1,23 @@
/*
* Copyright (c) 2021 Nordic Semiconductor ASA
*
* SPDX-License-Identifier: Apache-2.0
*/
#ifndef ZEPHYR_INCLUDE_TOOLCHAIN_ARMCLANG_H_
#define ZEPHYR_INCLUDE_TOOLCHAIN_ARMCLANG_H_
#include <toolchain/llvm.h>
/*
* To reuse as much as possible from the llvm.h header we only redefine the
* __GENERIC_SECTION and Z_GENERIC_SECTION macros here to include the `used` keyword.
*/
#undef __GENERIC_SECTION
#undef Z_GENERIC_SECTION
#define __GENERIC_SECTION(segment) __attribute__((section(STRINGIFY(segment)), used))
#define Z_GENERIC_SECTION(segment) __GENERIC_SECTION(segment)
#endif /* ZEPHYR_INCLUDE_TOOLCHAIN_ARMCLANG_H_ */