Skip to content

[libc] Stop depending on .cpp files libcxx_shared_headers library. #133999

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 1, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions libc/src/__support/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ add_header_library(
DEPENDS
.ctype_utils
.str_to_num_result
libc.src.errno.errno
libc.hdr.errno_macros
libc.src.__support.CPP.limits
libc.src.__support.CPP.type_traits
libc.src.__support.common
Expand Down Expand Up @@ -217,6 +217,7 @@ add_header_library(
.str_to_integer
.str_to_num_result
.uint128
libc.hdr.errno_macros
libc.src.__support.common
libc.src.__support.CPP.bit
libc.src.__support.CPP.limits
Expand All @@ -226,7 +227,6 @@ add_header_library(
libc.src.__support.macros.config
libc.src.__support.macros.null_check
libc.src.__support.macros.optimization
libc.src.errno.errno
)

add_header_library(
Expand Down
2 changes: 1 addition & 1 deletion libc/src/__support/libc_assert.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
#ifndef LLVM_LIBC_SRC___SUPPORT_LIBC_ASSERT_H
#define LLVM_LIBC_SRC___SUPPORT_LIBC_ASSERT_H

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

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

namespace LIBC_NAMESPACE_DECL {
Expand Down
2 changes: 1 addition & 1 deletion libc/src/__support/str_to_float.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
#ifndef LLVM_LIBC_SRC___SUPPORT_STR_TO_FLOAT_H
#define LLVM_LIBC_SRC___SUPPORT_STR_TO_FLOAT_H

#include "hdr/errno_macros.h" // For ERANGE
#include "src/__support/CPP/bit.h"
#include "src/__support/CPP/limits.h"
#include "src/__support/CPP/optional.h"
Expand All @@ -31,7 +32,6 @@
#include "src/__support/str_to_integer.h"
#include "src/__support/str_to_num_result.h"
#include "src/__support/uint128.h"
#include "src/errno/libc_errno.h" // For ERANGE

#include <stdint.h>

Expand Down
2 changes: 1 addition & 1 deletion libc/src/__support/str_to_integer.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
#ifndef LLVM_LIBC_SRC___SUPPORT_STR_TO_INTEGER_H
#define LLVM_LIBC_SRC___SUPPORT_STR_TO_INTEGER_H

#include "hdr/errno_macros.h" // For ERANGE
#include "src/__support/CPP/limits.h"
#include "src/__support/CPP/type_traits.h"
#include "src/__support/CPP/type_traits/make_unsigned.h"
Expand All @@ -24,7 +25,6 @@
#include "src/__support/macros/config.h"
#include "src/__support/str_to_num_result.h"
#include "src/__support/uint128.h"
#include "src/errno/libc_errno.h" // For ERANGE

namespace LIBC_NAMESPACE_DECL {
namespace internal {
Expand Down
26 changes: 3 additions & 23 deletions utils/bazel/llvm-project-overlay/libc/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -841,12 +841,6 @@ libc_support_library(
libc_support_library(
name = "__support_libc_assert",
hdrs = ["src/__support/libc_assert.h"],
deps = [
":__support_integer_to_string",
":__support_macros_attributes",
":__support_osutil_exit",
":__support_osutil_io",
],
)

libc_support_library(
Expand All @@ -868,7 +862,7 @@ libc_support_library(
":__support_ctype_utils",
":__support_str_to_num_result",
":__support_uint128",
":errno",
":hdr_errno_macros",
],
)

Expand All @@ -892,7 +886,7 @@ libc_support_library(
":__support_str_to_integer",
":__support_str_to_num_result",
":__support_uint128",
":errno",
":hdr_errno_macros",
],
)

Expand Down Expand Up @@ -1590,21 +1584,6 @@ libc_support_library(

########################## externally shared targets ###########################

# TODO: Remove this once downstream users are migrated to libcxx_shared_headers.
libc_support_library(
name = "libc_external_common",
hdrs = glob(
["shared/*.h"],
exclude = ["shared/rpc_server.h"],
),
deps = [
":__support_common",
":__support_fputil_fp_bits",
":__support_str_to_float",
":__support_str_to_integer",
],
)

libc_header_library(
name = "libcxx_shared_headers",
hdrs = [
Expand Down Expand Up @@ -1911,6 +1890,7 @@ libc_support_library(
":__support_fputil_fma",
":__support_fputil_multiply_add",
":__support_fputil_polyeval",
":__support_integer_literals",
],
)

Expand Down
Loading