Skip to content

Commit 65e657b

Browse files
committed
LLVM 20 release contains a bug that it one of the headers in `libc/src/__support` directory includes a header from `libc/src/errno`, which is not one of the header directories that are meant to be included: https://github.com/llvm/llvm-project/blob/ec28b8f9cc7f2ac187d8a617a6d08d5e56f9120e/libc/src/__support/str_to_float.h#L34 I was told (llvm/llvm-project#91651 (comment)) this was a bug that was fixed in llvm/llvm-project#133999. Whether this fix will be backported to later version of LLVM 20 release is unclear. To avoid importing files from `libc/src`, this applies the fix here as well.
1 parent af9d27d commit 65e657b

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

system/lib/llvm-libc/src/__support/libc_assert.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
#ifndef LLVM_LIBC_SRC___SUPPORT_LIBC_ASSERT_H
1010
#define LLVM_LIBC_SRC___SUPPORT_LIBC_ASSERT_H
1111

12-
#include "src/__support/macros/config.h"
1312
#if defined(LIBC_COPT_USE_C_ASSERT) || !defined(LIBC_FULL_BUILD)
1413

1514
// The build is configured to just use the public <assert.h> API
@@ -25,6 +24,7 @@
2524
#include "src/__support/OSUtil/io.h"
2625
#include "src/__support/integer_to_string.h"
2726
#include "src/__support/macros/attributes.h" // For LIBC_INLINE
27+
#include "src/__support/macros/config.h"
2828
#include "src/__support/macros/optimization.h" // For LIBC_UNLIKELY
2929

3030
namespace LIBC_NAMESPACE_DECL {

system/lib/llvm-libc/src/__support/str_to_float.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
#ifndef LLVM_LIBC_SRC___SUPPORT_STR_TO_FLOAT_H
1616
#define LLVM_LIBC_SRC___SUPPORT_STR_TO_FLOAT_H
1717

18+
#include "hdr/errno_macros.h" // For ERANGE
1819
#include "src/__support/CPP/bit.h"
1920
#include "src/__support/CPP/limits.h"
2021
#include "src/__support/CPP/optional.h"
@@ -31,7 +32,6 @@
3132
#include "src/__support/str_to_integer.h"
3233
#include "src/__support/str_to_num_result.h"
3334
#include "src/__support/uint128.h"
34-
#include "src/errno/libc_errno.h" // For ERANGE
3535

3636
#include <stdint.h>
3737

system/lib/llvm-libc/src/__support/str_to_integer.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
#ifndef LLVM_LIBC_SRC___SUPPORT_STR_TO_INTEGER_H
1616
#define LLVM_LIBC_SRC___SUPPORT_STR_TO_INTEGER_H
1717

18+
#include "hdr/errno_macros.h" // For ERANGE
1819
#include "src/__support/CPP/limits.h"
1920
#include "src/__support/CPP/type_traits.h"
2021
#include "src/__support/CPP/type_traits/make_unsigned.h"
@@ -24,7 +25,6 @@
2425
#include "src/__support/macros/config.h"
2526
#include "src/__support/str_to_num_result.h"
2627
#include "src/__support/uint128.h"
27-
#include "src/errno/libc_errno.h" // For ERANGE
2828

2929
namespace LIBC_NAMESPACE_DECL {
3030
namespace internal {

0 commit comments

Comments
 (0)