Zephyr API Documentation
4.2.99
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
toolchain.h
Go to the documentation of this file.
1
/*
2
* Copyright (c) 2010-2014, Wind River Systems, Inc.
3
*
4
* SPDX-License-Identifier: Apache-2.0
5
*/
6
14
15
#ifndef ZEPHYR_INCLUDE_TOOLCHAIN_H_
16
#define ZEPHYR_INCLUDE_TOOLCHAIN_H_
17
25
#ifdef __has_builtin
26
#define HAS_BUILTIN(x) __has_builtin(x)
27
#else
28
/*
29
* The compiler doesn't provide the __has_builtin() macro, so instead we depend
30
* on the toolchain-specific headers to define HAS_BUILTIN_x for the builtins
31
* supported.
32
*/
33
#define HAS_BUILTIN(x) HAS_BUILTIN_##x
34
#endif
35
36
#if defined(__TOOLCHAIN_CUSTOM__)
37
/* This include line exists for off-tree definitions of compilers,
38
* and therefore this header is not meant to exist in-tree
39
*/
40
#include <toolchain/other.h>
41
#elif defined(__XCC__)
42
#include <
zephyr/toolchain/xcc.h
>
43
#elif defined(__CCAC__)
44
#include <
zephyr/toolchain/mwdt.h
>
45
#elif defined(__ARMCOMPILER_VERSION)
46
#include <
zephyr/toolchain/armclang.h
>
47
#elif defined(__IAR_SYSTEMS_ICC__)
48
#include <
zephyr/toolchain/iar.h
>
49
#elif defined(__llvm__) || (defined(_LINKER) && defined(__LLD_LINKER_CMD__))
50
#include <
zephyr/toolchain/llvm.h
>
51
#elif defined(__GNUC__) || (defined(_LINKER) && defined(__GCC_LINKER_CMD__))
52
#include <
zephyr/toolchain/gcc.h
>
53
#else
54
#error "Invalid/unknown toolchain configuration"
55
#endif
56
68
#ifndef __noasan
69
#define __noasan
/**/
70
#endif
71
76
#ifndef TOOLCHAIN_GCC_VERSION
77
#define TOOLCHAIN_GCC_VERSION 0
78
#endif
79
84
#ifndef TOOLCHAIN_CLANG_VERSION
85
#define TOOLCHAIN_CLANG_VERSION 0
86
#endif
87
92
#ifndef TOOLCHAIN_HAS_PRAGMA_DIAG
93
#define TOOLCHAIN_HAS_PRAGMA_DIAG 0
94
#endif
95
100
#if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L
101
/* _Generic is introduced in C11, so it is supported. */
102
# ifdef TOOLCHAIN_HAS_C_GENERIC
103
# undef TOOLCHAIN_HAS_C_GENERIC
104
# endif
105
# define TOOLCHAIN_HAS_C_GENERIC 1
106
#else
107
# ifndef TOOLCHAIN_HAS_C_GENERIC
108
# define TOOLCHAIN_HAS_C_GENERIC 0
109
# endif
110
#endif
111
116
#ifndef TOOLCHAIN_HAS_C_AUTO_TYPE
117
#define TOOLCHAIN_HAS_C_AUTO_TYPE 0
118
#endif
119
124
#ifndef TOOLCHAIN_HAS_ZLA
125
#define TOOLCHAIN_HAS_ZLA 0
126
#endif
127
132
#ifdef TOOLCHAIN_HAS_PRAGMA_DIAG
133
#define TOOLCHAIN_PRAGMA(x) _Pragma(#x)
134
#else
135
#define TOOLCHAIN_PRAGMA(x)
136
#endif
137
145
#ifndef TOOLCHAIN_WARNING_ADDRESS_OF_PACKED_MEMBER
146
#define TOOLCHAIN_WARNING_ADDRESS_OF_PACKED_MEMBER
147
#endif
148
156
#ifndef TOOLCHAIN_WARNING_ARRAY_BOUNDS
157
#define TOOLCHAIN_WARNING_ARRAY_BOUNDS
158
#endif
159
167
#ifndef TOOLCHAIN_WARNING_ATTRIBUTES
168
#define TOOLCHAIN_WARNING_ATTRIBUTES
169
#endif
170
179
#ifndef TOOLCHAIN_WARNING_DELETE_NON_VIRTUAL_DTOR
180
#define TOOLCHAIN_WARNING_DELETE_NON_VIRTUAL_DTOR
181
#endif
182
190
#ifndef TOOLCHAIN_WARNING_EXTRA
191
#define TOOLCHAIN_WARNING_EXTRA
192
#endif
193
201
#ifndef TOOLCHAIN_WARNING_NONNULL
202
#define TOOLCHAIN_WARNING_NONNULL
203
#endif
204
212
#ifndef TOOLCHAIN_WARNING_POINTER_ARITH
213
#define TOOLCHAIN_WARNING_POINTER_ARITH
214
#endif
215
223
#ifndef TOOLCHAIN_WARNING_SHADOW
224
#define TOOLCHAIN_WARNING_SHADOW
225
#endif
226
234
#ifndef TOOLCHAIN_WARNING_UNUSED_LABEL
235
#define TOOLCHAIN_WARNING_UNUSED_LABEL
236
#endif
237
245
#ifndef TOOLCHAIN_WARNING_UNUSED_VARIABLE
246
#define TOOLCHAIN_WARNING_UNUSED_VARIABLE
247
#endif
248
256
#ifndef TOOLCHAIN_WARNING_CAST_QUAL
257
#define TOOLCHAIN_WARNING_CAST_QUAL
258
#endif
259
264
#ifndef TOOLCHAIN_DISABLE_WARNING
265
#define TOOLCHAIN_DISABLE_WARNING(warning)
266
#endif
267
274
#ifndef TOOLCHAIN_ENABLE_WARNING
275
#define TOOLCHAIN_ENABLE_WARNING(warning)
276
#endif
277
282
#ifndef TOOLCHAIN_DISABLE_CLANG_WARNING
283
#define TOOLCHAIN_DISABLE_CLANG_WARNING(warning)
284
#endif
285
292
#ifndef TOOLCHAIN_ENABLE_CLANG_WARNING
293
#define TOOLCHAIN_ENABLE_CLANG_WARNING(warning)
294
#endif
295
300
#ifndef TOOLCHAIN_DISABLE_GCC_WARNING
301
#define TOOLCHAIN_DISABLE_GCC_WARNING(warning)
302
#endif
303
310
#ifndef TOOLCHAIN_ENABLE_GCC_WARNING
311
#define TOOLCHAIN_ENABLE_GCC_WARNING(warning)
312
#endif
313
318
#ifndef TOOLCHAIN_DISABLE_IAR_WARNING
319
#define TOOLCHAIN_DISABLE_IAR_WARNING(warning)
320
#endif
321
328
#ifndef TOOLCHAIN_ENABLE_IAR_WARNING
329
#define TOOLCHAIN_ENABLE_IAR_WARNING(warning)
330
#endif
331
332
/*
333
* Ensure that __BYTE_ORDER__ and related preprocessor definitions are defined,
334
* and that they match the Kconfig option that is used in the code itself to
335
* check for endianness.
336
*/
337
#ifndef _LINKER
338
#if !defined(__BYTE_ORDER__) || !defined(__ORDER_BIG_ENDIAN__) || \
339
!defined(__ORDER_LITTLE_ENDIAN__)
340
341
/*
342
* Displaying values unfortunately requires #pragma message which can't
343
* be taken for granted + STRINGIFY() which is not available in this .h
344
* file.
345
*/
346
#error "At least one byte _ORDER_ macro is not defined"
347
348
#else
349
350
#if (defined(CONFIG_BIG_ENDIAN) && (__BYTE_ORDER__ != __ORDER_BIG_ENDIAN__)) || \
351
(defined(CONFIG_LITTLE_ENDIAN) && (__BYTE_ORDER__ != __ORDER_LITTLE_ENDIAN__))
352
353
# error "Kconfig/toolchain endianness mismatch:"
354
355
# if (__BYTE_ORDER__ != __ORDER_BIG_ENDIAN__) && (__BYTE_ORDER__ != __ORDER_LITTLE_ENDIAN__)
356
# error "Unknown __BYTE_ORDER__ value"
357
# else
358
# ifdef CONFIG_BIG_ENDIAN
359
# error "CONFIG_BIG_ENDIAN but __ORDER_LITTLE_ENDIAN__"
360
# endif
361
# ifdef CONFIG_LITTLE_ENDIAN
362
# error "CONFIG_LITTLE_ENDIAN but __ORDER_BIG_ENDIAN__"
363
# endif
364
# endif
365
366
#endif
/* Endianness mismatch */
367
368
#endif
/* all _ORDER_ macros defined */
369
370
#endif
/* !_LINKER */
371
372
#endif
/* ZEPHYR_INCLUDE_TOOLCHAIN_H_ */
armclang.h
iar.h
gcc.h
GCC toolchain abstraction.
llvm.h
mwdt.h
xcc.h
zephyr
toolchain.h
Generated on
for Zephyr API Documentation by
1.14.0