1 /* SPDX-License-Identifier: LGPL-2.1 OR MIT */
3 * NOLIBC compiler support header
4 * Copyright (C) 2023 Thomas Weißschuh <linux@weissschuh.net>
6 #ifndef _NOLIBC_COMPILER_H
7 #define _NOLIBC_COMPILER_H
9 #if defined(__SSP__) || defined(__SSP_STRONG__) || defined(__SSP_ALL__) || defined(__SSP_EXPLICIT__)
11 #define _NOLIBC_STACKPROTECTOR
13 #endif /* defined(__SSP__) ... */
15 #if defined(__has_attribute)
16 # if __has_attribute(no_stack_protector)
17 # define __no_stack_protector __attribute__((no_stack_protector))
19 # define __no_stack_protector __attribute__((__optimize__("-fno-stack-protector")))
22 # define __no_stack_protector __attribute__((__optimize__("-fno-stack-protector")))
23 #endif /* defined(__has_attribute) */
25 #endif /* _NOLIBC_COMPILER_H */