1 //===-- Including stdlib.h in overlay mode --------------------------------===//
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //===----------------------------------------------------------------------===//
9 #ifndef LLVM_LIBC_HDR_STDLIB_OVERLAY_H
10 #define LLVM_LIBC_HDR_STDLIB_OVERLAY_H
12 #ifdef LIBC_FULL_BUILD
13 #error "This header should only be included in overlay mode"
18 // glibc <stdlib.h> header might provide extern inline definitions for few
19 // functions, causing external alias errors. They are guarded by
20 // `__USE_FORTIFY_LEVEL`, which will be temporarily disabled.
22 #ifdef __USE_FORTIFY_LEVEL
23 #define LIBC_OLD_USE_FORTIFY_LEVEL __USE_FORTIFY_LEVEL
24 #undef __USE_FORTIFY_LEVEL
25 #define __USE_FORTIFY_LEVEL 0
30 #ifdef LIBC_OLD_USE_FORTIFY_LEVEL
31 #undef __USE_FORTIFY_LEVEL
32 #define __USE_FORTIFY_LEVEL LIBC_OLD_USE_FORTIFY_LEVEL
33 #undef LIBC_OLD_USE_FORTIFY_LEVEL