Skip to content

Commit

Permalink
[AIE][LIBC] Temporary fix for errno declaration on AIE
Browse files Browse the repository at this point in the history
Current libc allows to configure the definition of errno, but not its declaration.
The declaration always adds thread_local, which isn't supported on AIE.
A recent upstream commit introduced proper support for configuring errno. Until then, we add guards for AIE.
  • Loading branch information
konstantinschwarz committed Jul 18, 2024
1 parent f6306d8 commit 21fbb97
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions libc/include/errno.h.def
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 21fbb97

Please sign in to comment.