diff --git a/libc/include/errno.h.def b/libc/include/errno.h.def index 90bd8bfecf2f..b5adce6e1a84 100644 --- a/libc/include/errno.h.def +++ b/libc/include/errno.h.def @@ -4,6 +4,8 @@ // See https://llvm.org/LICENSE.txt for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // +// Modifications (c) Copyright 2024 Advanced Micro Devices, Inc. or its affiliates +// //===----------------------------------------------------------------------===// #ifndef LLVM_LIBC_ERRNO_H @@ -47,7 +49,11 @@ #ifdef __cplusplus extern "C" { +#ifdef __AIECC__ +extern int __llvmlibc_errno; +#else extern thread_local int __llvmlibc_errno; +#endif } #else extern _Thread_local int __llvmlibc_errno;