1 # This file is licensed under the Apache License v2.0 with LLVM Exceptions.
2 # See https://llvm.org/LICENSE.txt for license information.
3 # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 load("@bazel_skylib//lib:selects.bzl", "selects")
7 load("@bazel_skylib//rules:common_settings.bzl", "string_flag")
9 ":libc_build_rules.bzl",
12 "libc_support_library",
14 load(":platforms.bzl", "PLATFORM_CPU_ARM64", "PLATFORM_CPU_X86_64")
17 default_visibility = ["//visibility:public"],
19 "-use_header_modules",
27 "LIBC_COPT_STDIO_USE_SYSTEM_FILE",
28 "LIBC_COPT_PRINTF_DISABLE_INDEX_MODE",
29 "LIBC_COPT_PRINTF_DISABLE_WRITE_INT",
33 # "LIBC_COPT_MEMCPY_X86_USE_REPMOVSB_FROM_SIZE=0",
34 # "LIBC_COPT_MEMCPY_X86_USE_SOFTWARE_PREFETCHING",
35 # "LIBC_COPT_MEMSET_X86_USE_SOFTWARE_PREFETCHING",
38 # A flag to pick which `mpfr` to use for math tests.
39 # Usage: `--@llvm-project//libc:mpfr=<disable|external|system>`.
40 # Flag documentation: https://bazel.build/extending/config
43 build_setting_default = "external",
45 "disable", # Skip tests that need mpfr
46 "external", # Build mpfr from source
47 "system", # Use system mpfr (non hermetic)
52 name = "mpfr_disable",
53 flag_values = {":mpfr": "disable"},
57 name = "mpfr_external",
58 flag_values = {":mpfr": "external"},
63 flag_values = {":mpfr": "system"},
66 ############################## Support libraries #############################
69 name = "__support_macros_properties_architectures",
70 hdrs = ["src/__support/macros/properties/architectures.h"],
74 name = "__support_macros_properties_compiler",
75 hdrs = ["src/__support/macros/properties/compiler.h"],
79 name = "__support_macros_properties_os",
80 hdrs = ["src/__support/macros/properties/os.h"],
84 name = "__support_macros_properties_float",
85 hdrs = ["src/__support/macros/properties/float.h"],
87 ":__support_macros_properties_architectures",
88 ":__support_macros_properties_compiler",
89 ":__support_macros_properties_cpu_features",
90 ":__support_macros_properties_os",
95 name = "__support_macros_properties_cpu_features",
96 hdrs = ["src/__support/macros/properties/cpu_features.h"],
98 "__support_macros_properties_architectures",
102 libc_support_library(
103 name = "__support_macros_config",
104 hdrs = ["src/__support/macros/config.h"],
107 libc_support_library(
108 name = "__support_macros_attributes",
109 hdrs = ["src/__support/macros/attributes.h"],
111 ":__support_macros_properties_architectures",
115 libc_support_library(
116 name = "__support_macros_optimization",
117 hdrs = ["src/__support/macros/optimization.h"],
119 ":__support_macros_attributes",
120 ":__support_macros_config",
121 ":__support_macros_properties_compiler",
125 libc_support_library(
126 name = "__support_macros_sanitizer",
127 hdrs = ["src/__support/macros/sanitizer.h"],
129 ":__support_macros_config",
133 libc_support_library(
134 name = "__support_common",
136 "src/__support/common.h",
137 "src/__support/endian.h",
140 ":__support_macros_attributes",
141 ":__support_macros_properties_architectures",
145 libc_support_library(
146 name = "__support_cpp_algorithm",
147 hdrs = ["src/__support/CPP/algorithm.h"],
149 ":__support_macros_attributes",
153 libc_support_library(
154 name = "__support_cpp_array",
155 hdrs = ["src/__support/CPP/array.h"],
157 ":__support_macros_attributes",
161 libc_support_library(
162 name = "__support_cpp_bit",
163 hdrs = ["src/__support/CPP/bit.h"],
165 ":__support_cpp_limits",
166 ":__support_cpp_type_traits",
167 ":__support_macros_attributes",
168 ":__support_macros_config",
169 ":__support_macros_sanitizer",
173 libc_support_library(
174 name = "__support_cpp_bitset",
175 hdrs = ["src/__support/CPP/bitset.h"],
177 ":__support_macros_attributes",
181 libc_support_library(
182 name = "__support_cpp_cstddef",
183 hdrs = ["src/__support/CPP/cstddef.h"],
185 ":__support_cpp_type_traits",
186 ":__support_macros_attributes",
190 libc_support_library(
191 name = "__support_cpp_expected",
192 hdrs = ["src/__support/CPP/expected.h"],
197 libc_support_library(
198 name = "__support_cpp_functional",
199 hdrs = ["src/__support/CPP/functional.h"],
201 "__support_cpp_type_traits",
202 "__support_cpp_utility",
203 "__support_macros_attributes",
207 libc_support_library(
208 name = "__support_cpp_limits",
209 hdrs = ["src/__support/CPP/limits.h"],
211 "__support_cpp_type_traits",
212 "__support_macros_attributes",
216 libc_support_library(
217 name = "__support_cpp_new",
218 srcs = ["src/__support/CPP/new.cpp"],
219 hdrs = ["src/__support/CPP/new.h"],
225 libc_support_library(
226 name = "__support_cpp_optional",
227 hdrs = ["src/__support/CPP/optional.h"],
229 ":__support_cpp_utility",
233 libc_support_library(
234 name = "__support_cpp_span",
235 hdrs = ["src/__support/CPP/span.h"],
237 ":__support_cpp_array",
238 ":__support_cpp_type_traits",
242 libc_support_library(
243 name = "__support_cpp_string_view",
244 hdrs = ["src/__support/CPP/string_view.h"],
250 libc_support_library(
251 name = "__support_cpp_stringstream",
252 hdrs = ["src/__support/CPP/stringstream.h"],
254 ":__support_cpp_span",
255 ":__support_cpp_string_view",
256 ":__support_cpp_type_traits",
257 ":__support_integer_to_string",
261 libc_support_library(
262 name = "__support_cpp_string",
263 hdrs = ["src/__support/CPP/string.h"],
266 ":__support_cpp_string_view",
267 ":__support_integer_to_string",
268 ":string_memory_utils",
273 libc_support_library(
274 name = "__support_cpp_type_traits",
276 "src/__support/CPP/type_traits.h",
277 "src/__support/CPP/type_traits/add_lvalue_reference.h",
278 "src/__support/CPP/type_traits/add_pointer.h",
279 "src/__support/CPP/type_traits/add_rvalue_reference.h",
280 "src/__support/CPP/type_traits/always_false.h",
281 "src/__support/CPP/type_traits/bool_constant.h",
282 "src/__support/CPP/type_traits/conditional.h",
283 "src/__support/CPP/type_traits/decay.h",
284 "src/__support/CPP/type_traits/enable_if.h",
285 "src/__support/CPP/type_traits/false_type.h",
286 "src/__support/CPP/type_traits/integral_constant.h",
287 "src/__support/CPP/type_traits/invoke.h",
288 "src/__support/CPP/type_traits/invoke_result.h",
289 "src/__support/CPP/type_traits/is_arithmetic.h",
290 "src/__support/CPP/type_traits/is_array.h",
291 "src/__support/CPP/type_traits/is_base_of.h",
292 "src/__support/CPP/type_traits/is_class.h",
293 "src/__support/CPP/type_traits/is_const.h",
294 "src/__support/CPP/type_traits/is_convertible.h",
295 "src/__support/CPP/type_traits/is_destructible.h",
296 "src/__support/CPP/type_traits/is_enum.h",
297 "src/__support/CPP/type_traits/is_floating_point.h",
298 "src/__support/CPP/type_traits/is_function.h",
299 "src/__support/CPP/type_traits/is_integral.h",
300 "src/__support/CPP/type_traits/is_lvalue_reference.h",
301 "src/__support/CPP/type_traits/is_member_pointer.h",
302 "src/__support/CPP/type_traits/is_null_pointer.h",
303 "src/__support/CPP/type_traits/is_object.h",
304 "src/__support/CPP/type_traits/is_pointer.h",
305 "src/__support/CPP/type_traits/is_reference.h",
306 "src/__support/CPP/type_traits/is_rvalue_reference.h",
307 "src/__support/CPP/type_traits/is_same.h",
308 "src/__support/CPP/type_traits/is_scalar.h",
309 "src/__support/CPP/type_traits/is_signed.h",
310 "src/__support/CPP/type_traits/is_trivially_constructible.h",
311 "src/__support/CPP/type_traits/is_trivially_copyable.h",
312 "src/__support/CPP/type_traits/is_trivially_destructible.h",
313 "src/__support/CPP/type_traits/is_union.h",
314 "src/__support/CPP/type_traits/is_unsigned.h",
315 "src/__support/CPP/type_traits/is_void.h",
316 "src/__support/CPP/type_traits/make_signed.h",
317 "src/__support/CPP/type_traits/make_unsigned.h",
318 "src/__support/CPP/type_traits/remove_all_extents.h",
319 "src/__support/CPP/type_traits/remove_cv.h",
320 "src/__support/CPP/type_traits/remove_cvref.h",
321 "src/__support/CPP/type_traits/remove_extent.h",
322 "src/__support/CPP/type_traits/remove_reference.h",
323 "src/__support/CPP/type_traits/true_type.h",
324 "src/__support/CPP/type_traits/type_identity.h",
325 "src/__support/CPP/type_traits/void_t.h",
326 "src/__support/CPP/utility/declval.h",
327 "src/__support/CPP/utility/forward.h",
330 ":__support_macros_attributes",
331 ":__support_macros_config",
332 ":__support_macros_properties_float",
336 libc_support_library(
337 name = "__support_cpp_utility",
339 "src/__support/CPP/utility.h",
340 "src/__support/CPP/utility/declval.h",
341 "src/__support/CPP/utility/forward.h",
342 "src/__support/CPP/utility/in_place.h",
343 "src/__support/CPP/utility/integer_sequence.h",
344 "src/__support/CPP/utility/move.h",
347 ":__support_cpp_type_traits",
348 ":__support_macros_attributes",
352 libc_support_library(
353 name = "__support_cpp_atomic",
354 hdrs = ["src/__support/CPP/atomic.h"],
356 ":__support_cpp_type_traits",
357 ":__support_macros_attributes",
358 ":__support_macros_properties_architectures",
362 libc_support_library(
363 name = "__support_blockstore",
364 hdrs = ["src/__support/blockstore.h"],
366 ":__support_cpp_new",
367 ":__support_libc_assert",
371 libc_support_library(
372 name = "__support_arg_list",
373 hdrs = ["src/__support/arg_list.h"],
379 libc_support_library(
380 name = "__support_c_string",
381 hdrs = ["src/__support/c_string.h"],
383 ":__support_cpp_string",
387 libc_support_library(
388 name = "__support_fixedvector",
389 hdrs = ["src/__support/fixedvector.h"],
391 ":__support_cpp_array",
395 libc_support_library(
396 name = "__support_char_vector",
397 hdrs = ["src/__support/char_vector.h"],
403 libc_support_library(
404 name = "__support_error_or",
405 hdrs = ["src/__support/error_or.h"],
408 ":__support_cpp_expected",
412 libc_support_library(
413 name = "__support_float_to_string",
415 "src/__support/float_to_string.h",
416 "src/__support/ryu_constants.h",
417 "src/__support/ryu_long_double_constants.h",
419 defines = ["LIBC_COPT_FLOAT_TO_STR_USE_MEGA_LONG_DOUBLE_TABLE"],
422 ":__support_cpp_type_traits",
423 ":__support_fputil_dyadic_float",
424 ":__support_fputil_fp_bits",
425 ":__support_libc_assert",
430 libc_support_library(
431 name = "__support_number_pair",
432 hdrs = ["src/__support/number_pair.h"],
434 ":__support_cpp_type_traits",
438 libc_support_library(
439 name = "__support_integer_utils",
440 hdrs = ["src/__support/integer_utils.h"],
443 ":__support_cpp_type_traits",
444 ":__support_math_extras",
445 ":__support_number_pair",
449 libc_support_library(
450 name = "__support_uint",
451 hdrs = ["src/__support/UInt.h"],
453 ":__support_cpp_array",
454 ":__support_cpp_bit",
455 ":__support_cpp_limits",
456 ":__support_cpp_optional",
457 ":__support_cpp_type_traits",
458 ":__support_integer_utils",
459 ":__support_macros_attributes",
460 ":__support_macros_optimization",
461 ":__support_math_extras",
462 ":__support_number_pair",
466 libc_support_library(
467 name = "__support_uint128",
468 hdrs = ["src/__support/UInt128.h"],
474 libc_support_library(
475 name = "__support_str_to_num_result",
476 hdrs = ["src/__support/str_to_num_result.h"],
477 deps = [":__support_macros_attributes"],
480 libc_support_library(
481 name = "__support_integer_operations",
482 hdrs = ["src/__support/integer_operations.h"],
483 deps = [":__support_cpp_type_traits"],
486 libc_support_library(
487 name = "__support_integer_to_string",
488 hdrs = ["src/__support/integer_to_string.h"],
491 ":__support_cpp_algorithm",
492 ":__support_cpp_bit",
493 ":__support_cpp_limits",
494 ":__support_cpp_optional",
495 ":__support_cpp_span",
496 ":__support_cpp_string_view",
497 ":__support_cpp_type_traits",
501 libc_support_library(
502 name = "__support_libc_assert",
503 hdrs = ["src/__support/libc_assert.h"],
505 ":__support_integer_to_string",
506 ":__support_macros_attributes",
507 ":__support_osutil_io",
508 ":__support_osutil_quick_exit",
512 libc_support_library(
513 name = "__support_ctype_utils",
514 hdrs = ["src/__support/ctype_utils.h"],
515 deps = [":__support_macros_attributes"],
518 libc_support_library(
519 name = "__support_str_to_integer",
520 hdrs = ["src/__support/str_to_integer.h"],
523 ":__support_cpp_limits",
524 ":__support_cpp_type_traits",
525 ":__support_ctype_utils",
526 ":__support_str_to_num_result",
531 libc_support_library(
532 name = "__support_str_to_float",
534 "src/__support/detailed_powers_of_ten.h",
535 "src/__support/high_precision_decimal.h",
536 "src/__support/str_to_float.h",
540 ":__support_cpp_bit",
541 ":__support_cpp_limits",
542 ":__support_cpp_optional",
543 ":__support_ctype_utils",
544 ":__support_fputil_dyadic_float",
545 ":__support_fputil_fenv_impl",
546 ":__support_fputil_fp_bits",
547 ":__support_fputil_rounding_mode",
548 ":__support_str_to_integer",
549 ":__support_str_to_num_result",
550 ":__support_uint128",
555 libc_support_library(
556 name = "__support_fputil_basic_operations",
557 hdrs = ["src/__support/FPUtil/BasicOperations.h"],
560 ":__support_cpp_type_traits",
561 ":__support_fputil_fp_bits",
565 libc_support_library(
566 name = "__support_file_file",
567 srcs = ["src/__support/File/file.cpp"],
568 hdrs = ["src/__support/File/file.h"],
570 ":__support_cpp_new",
571 ":__support_cpp_span",
572 ":__support_error_or",
573 ":__support_threads_mutex",
578 libc_support_library(
579 name = "__support_file_linux_lseekimpl",
580 hdrs = ["src/__support/File/linux/lseekImpl.h"],
583 ":__support_error_or",
584 ":__support_osutil_syscall",
589 libc_support_library(
590 name = "__support_math_extras",
591 hdrs = ["src/__support/math_extras.h"],
593 ":__support_cpp_type_traits",
594 ":__support_macros_attributes",
595 ":__support_macros_config",
599 libc_support_library(
600 name = "__support_fputil_generic_fmod",
601 hdrs = ["src/__support/FPUtil/generic/FMod.h"],
604 ":__support_cpp_bit",
605 ":__support_cpp_limits",
606 ":__support_cpp_type_traits",
607 ":__support_fputil_fenv_impl",
608 ":__support_fputil_fp_bits",
613 libc_support_library(
614 name = "__support_fputil_division_and_remainder_operations",
615 hdrs = ["src/__support/FPUtil/DivisionAndRemainderOperations.h"],
618 ":__support_cpp_type_traits",
619 ":__support_fputil_fp_bits",
620 ":__support_fputil_manipulation_functions",
621 ":__support_fputil_normal_float",
625 libc_support_library(
626 name = "__support_fputil_except_value_utils",
627 hdrs = ["src/__support/FPUtil/except_value_utils.h"],
629 ":__support_cpp_optional",
630 ":__support_fputil_fenv_impl",
631 ":__support_fputil_fp_bits",
632 ":__support_fputil_rounding_mode",
636 libc_support_library(
637 name = "__support_fputil_fenv_impl",
638 hdrs = ["src/__support/FPUtil/FEnvImpl.h"],
640 "src/__support/FPUtil/x86_64/FEnvImpl.h",
641 "src/__support/FPUtil/aarch64/FEnvImpl.h",
642 "src/__support/FPUtil/aarch64/fenv_darwin_impl.h",
645 ":__support_fputil_fp_bits",
646 ":__support_macros_attributes",
647 ":__support_macros_properties_architectures",
648 ":__support_macros_sanitizer",
653 libc_support_library(
654 name = "__support_fputil_rounding_mode",
655 hdrs = ["src/__support/FPUtil/rounding_mode.h"],
657 ":__support_macros_attributes",
661 libc_support_library(
662 name = "__support_fputil_fp_bits",
663 hdrs = ["src/__support/FPUtil/FPBits.h"],
664 textual_hdrs = ["src/__support/FPUtil/x86_64/LongDoubleBits.h"],
667 ":__support_cpp_bit",
668 ":__support_cpp_type_traits",
669 ":__support_macros_attributes",
670 ":__support_macros_properties_float",
671 ":__support_math_extras",
672 ":__support_uint128",
676 libc_support_library(
677 name = "__support_fputil_fpbits_str",
678 hdrs = ["src/__support/FPUtil/fpbits_str.h"],
681 ":__support_cpp_string",
682 ":__support_cpp_type_traits",
683 ":__support_fputil_fp_bits",
684 ":__support_integer_to_string",
685 ":__support_uint128",
689 libc_support_library(
690 name = "__support_fputil_hypot",
691 hdrs = ["src/__support/FPUtil/Hypot.h"],
694 ":__support_cpp_bit",
695 ":__support_cpp_type_traits",
696 ":__support_fputil_basic_operations",
697 ":__support_fputil_fenv_impl",
698 ":__support_fputil_fp_bits",
699 ":__support_fputil_rounding_mode",
700 ":__support_uint128",
704 libc_support_library(
705 name = "__support_fputil_manipulation_functions",
706 hdrs = ["src/__support/FPUtil/ManipulationFunctions.h"],
707 textual_hdrs = ["src/__support/FPUtil/x86_64/NextAfterLongDouble.h"],
710 ":__support_cpp_bit",
711 ":__support_cpp_type_traits",
712 ":__support_fputil_fp_bits",
713 ":__support_fputil_nearest_integer_operations",
714 ":__support_fputil_normal_float",
715 ":__support_macros_optimization",
716 ":__support_uint128",
720 libc_support_library(
721 name = "__support_fputil_nearest_integer_operations",
722 hdrs = ["src/__support/FPUtil/NearestIntegerOperations.h"],
725 ":__support_cpp_type_traits",
726 ":__support_fputil_fenv_impl",
727 ":__support_fputil_fp_bits",
728 ":__support_fputil_rounding_mode",
729 ":__support_macros_attributes",
733 libc_support_library(
734 name = "__support_fputil_normal_float",
735 hdrs = ["src/__support/FPUtil/NormalFloat.h"],
738 ":__support_cpp_type_traits",
739 ":__support_fputil_fp_bits",
744 "src/__support/FPUtil/sqrt.h",
745 "src/__support/FPUtil/generic/sqrt.h",
746 "src/__support/FPUtil/generic/sqrt_80_bit_long_double.h",
749 sqrt_hdrs = selects.with_or({
750 "//conditions:default": sqrt_common_hdrs,
751 PLATFORM_CPU_X86_64: sqrt_common_hdrs + [
752 "src/__support/FPUtil/x86_64/sqrt.h",
754 PLATFORM_CPU_ARM64: sqrt_common_hdrs + [
755 "src/__support/FPUtil/aarch64/sqrt.h",
759 libc_support_library(
760 name = "__support_fputil_sqrt",
764 ":__support_cpp_bit",
765 ":__support_cpp_type_traits",
766 ":__support_fputil_fenv_impl",
767 ":__support_fputil_fp_bits",
768 ":__support_fputil_rounding_mode",
769 ":__support_uint128",
774 "src/__support/FPUtil/FMA.h",
775 "src/__support/FPUtil/generic/FMA.h",
778 fma_platform_hdrs = [
779 "src/__support/FPUtil/x86_64/FMA.h",
780 "src/__support/FPUtil/aarch64/FMA.h",
783 libc_support_library(
784 name = "__support_fputil_fma",
785 hdrs = fma_common_hdrs,
786 # These are conditionally included and will #error out if the platform
787 # doesn't support FMA, so they can't be compiled on their own.
788 textual_hdrs = fma_platform_hdrs,
790 ":__support_cpp_bit",
791 ":__support_cpp_type_traits",
792 ":__support_fputil_fenv_impl",
793 ":__support_fputil_fp_bits",
794 ":__support_fputil_rounding_mode",
795 ":__support_macros_attributes",
796 ":__support_macros_optimization",
797 ":__support_macros_properties_cpu_features",
798 ":__support_uint128",
802 libc_support_library(
803 name = "__support_fputil_multiply_add",
805 "src/__support/FPUtil/multiply_add.h",
809 ":__support_fputil_fma",
813 libc_support_library(
814 name = "__support_fputil_polyeval",
816 "src/__support/FPUtil/PolyEval.h",
820 ":__support_fputil_multiply_add",
824 nearest_integer_common_hdrs = [
825 "src/__support/FPUtil/nearest_integer.h",
828 nearest_integer_platform_hdrs = [
829 "src/__support/FPUtil/x86_64/nearest_integer.h",
830 "src/__support/FPUtil/aarch64/nearest_integer.h",
833 libc_support_library(
834 name = "__support_fputil_nearest_integer",
835 hdrs = nearest_integer_common_hdrs,
836 # These are conditionally included and will #error out if the platform
837 # doesn't support rounding instructions, so they can't be compiled on their
839 textual_hdrs = nearest_integer_platform_hdrs,
842 ":__support_macros_optimization",
843 ":__support_macros_properties_architectures",
844 ":__support_macros_properties_cpu_features",
848 libc_support_library(
849 name = "__support_fputil_double_double",
850 hdrs = ["src/__support/FPUtil/double_double.h"],
853 ":__support_fputil_multiply_add",
854 ":__support_number_pair",
858 libc_support_library(
859 name = "__support_fputil_triple_double",
860 hdrs = ["src/__support/FPUtil/triple_double.h"],
866 libc_support_library(
867 name = "__support_fputil_dyadic_float",
868 hdrs = ["src/__support/FPUtil/dyadic_float.h"],
871 ":__support_fputil_fp_bits",
872 ":__support_fputil_multiply_add",
873 ":__support_macros_optimization",
878 libc_support_library(
879 name = "__support_osutil_syscall",
880 hdrs = ["src/__support/OSUtil/syscall.h"],
882 "src/__support/OSUtil/linux/syscall.h",
883 "src/__support/OSUtil/linux/aarch64/syscall.h",
884 "src/__support/OSUtil/linux/x86_64/syscall.h",
888 ":__support_cpp_bit",
892 libc_support_library(
893 name = "__support_osutil_io",
894 hdrs = ["src/__support/OSUtil/io.h"],
896 "src/__support/OSUtil/linux/io.h",
900 ":__support_cpp_string_view",
901 ":__support_osutil_syscall",
906 libc_support_library(
907 name = "__support_osutil_quick_exit",
908 hdrs = ["src/__support/OSUtil/quick_exit.h"],
910 "src/__support/OSUtil/linux/quick_exit.h",
911 #TODO: add support for GPU quick_exit (isn't just in a header.)
914 ":__support_osutil_syscall",
918 libc_support_library(
919 name = "__support_stringutil",
920 srcs = glob(["src/__support/StringUtil/tables/**/*.h"]) + [
921 "src/__support/StringUtil/error_to_string.cpp",
922 "src/__support/StringUtil/message_mapper.h",
923 "src/__support/StringUtil/platform_errors.h",
924 "src/__support/StringUtil/platform_signals.h",
925 "src/__support/StringUtil/signal_to_string.cpp",
928 "src/__support/StringUtil/error_to_string.h",
929 "src/__support/StringUtil/signal_to_string.h",
932 ":__support_cpp_array",
933 ":__support_cpp_span",
934 ":__support_cpp_string_view",
935 ":__support_cpp_stringstream",
936 ":__support_integer_to_string",
937 ":__support_macros_attributes",
942 libc_support_library(
943 name = "__support_threads_mutex",
945 "src/__support/threads/mutex.h",
946 "src/__support/threads/mutex_common.h",
949 "src/__support/threads/linux/mutex.h",
950 "src/__support/threads/linux/futex_word.h",
953 ":__support_cpp_atomic",
954 ":__support_osutil_syscall",
958 ############################### errno targets ################################
962 srcs = ["src/errno/libc_errno.cpp"],
963 hdrs = ["src/errno/libc_errno.h"],
966 ":__support_macros_attributes",
967 ":__support_macros_properties_architectures",
971 ################################ fenv targets ################################
974 name = "fetestexcept",
975 srcs = ["src/fenv/fetestexcept.cpp"],
976 hdrs = ["src/fenv/fetestexcept.h"],
979 ":__support_fputil_fenv_impl",
984 name = "feclearexcept",
985 srcs = ["src/fenv/feclearexcept.cpp"],
986 hdrs = ["src/fenv/feclearexcept.h"],
989 ":__support_fputil_fenv_impl",
994 name = "feraiseexcept",
995 srcs = ["src/fenv/feraiseexcept.cpp"],
996 hdrs = ["src/fenv/feraiseexcept.h"],
999 ":__support_fputil_fenv_impl",
1004 name = "fegetround",
1005 srcs = ["src/fenv/fegetround.cpp"],
1006 hdrs = ["src/fenv/fegetround.h"],
1008 ":__support_common",
1009 ":__support_fputil_fenv_impl",
1014 name = "fesetround",
1015 srcs = ["src/fenv/fesetround.cpp"],
1016 hdrs = ["src/fenv/fesetround.h"],
1018 ":__support_common",
1019 ":__support_fputil_fenv_impl",
1024 name = "fedisableexcept",
1025 srcs = ["src/fenv/fedisableexcept.cpp"],
1026 hdrs = ["src/fenv/fedisableexcept.h"],
1028 ":__support_common",
1029 ":__support_fputil_fenv_impl",
1034 name = "feenableexcept",
1035 srcs = ["src/fenv/feenableexcept.cpp"],
1036 hdrs = ["src/fenv/feenableexcept.h"],
1038 ":__support_common",
1039 ":__support_fputil_fenv_impl",
1044 name = "fegetexcept",
1045 srcs = ["src/fenv/fegetexcept.cpp"],
1046 hdrs = ["src/fenv/fegetexcept.h"],
1048 ":__support_common",
1049 ":__support_fputil_fenv_impl",
1055 srcs = ["src/fenv/fegetenv.cpp"],
1056 hdrs = ["src/fenv/fegetenv.h"],
1058 ":__support_common",
1059 ":__support_fputil_fenv_impl",
1065 srcs = ["src/fenv/fesetenv.cpp"],
1066 hdrs = ["src/fenv/fesetenv.h"],
1068 ":__support_common",
1069 ":__support_fputil_fenv_impl",
1074 name = "feupdateenv",
1075 srcs = ["src/fenv/feupdateenv.cpp"],
1076 hdrs = ["src/fenv/feupdateenv.h"],
1078 ":__support_common",
1079 ":__support_fputil_fenv_impl",
1084 name = "fegetexceptflag",
1085 srcs = ["src/fenv/fegetexceptflag.cpp"],
1086 hdrs = ["src/fenv/fegetexceptflag.h"],
1088 ":__support_common",
1089 ":__support_fputil_fenv_impl",
1094 name = "fesetexceptflag",
1095 srcs = ["src/fenv/fesetexceptflag.cpp"],
1096 hdrs = ["src/fenv/fesetexceptflag.h"],
1098 ":__support_common",
1099 ":__support_fputil_fenv_impl",
1104 name = "feholdexcept",
1105 srcs = ["src/fenv/feholdexcept.cpp"],
1106 hdrs = ["src/fenv/feholdexcept.h"],
1108 ":__support_common",
1109 ":__support_fputil_fenv_impl",
1113 ################################ math targets ################################
1115 libc_support_library(
1116 name = "math_utils",
1117 srcs = ["src/math/generic/math_utils.cpp"],
1118 hdrs = ["src/math/generic/math_utils.h"],
1120 "__support_cpp_bit",
1121 "__support_cpp_type_traits",
1122 ":__support_common",
1127 libc_support_library(
1128 name = "common_constants",
1129 srcs = ["src/math/generic/common_constants.cpp"],
1130 hdrs = ["src/math/generic/common_constants.h"],
1132 ":__support_fputil_triple_double",
1133 ":__support_number_pair",
1137 libc_support_library(
1138 name = "range_reduction",
1140 "src/math/generic/range_reduction.h",
1141 "src/math/generic/range_reduction_fma.h",
1144 ":__support_common",
1145 ":__support_fputil_fma",
1146 ":__support_fputil_fp_bits",
1147 ":__support_fputil_multiply_add",
1148 ":__support_fputil_nearest_integer",
1152 libc_support_library(
1153 name = "sincosf_utils",
1154 hdrs = ["src/math/generic/sincosf_utils.h"],
1156 ":__support_fputil_fp_bits",
1157 ":__support_fputil_polyeval",
1162 libc_support_library(
1164 srcs = ["src/math/generic/explogxf.cpp"],
1165 hdrs = ["src/math/generic/explogxf.h"],
1167 ":__support_common",
1168 ":__support_fputil_fenv_impl",
1169 ":__support_fputil_fma",
1170 ":__support_fputil_fp_bits",
1171 ":__support_fputil_multiply_add",
1172 ":__support_fputil_nearest_integer",
1173 ":__support_fputil_polyeval",
1174 ":common_constants",
1179 libc_support_library(
1180 name = "inv_trigf_utils",
1181 srcs = ["src/math/generic/inv_trigf_utils.cpp"],
1182 hdrs = ["src/math/generic/inv_trigf_utils.h"],
1184 ":__support_common",
1185 ":__support_fputil_fenv_impl",
1186 ":__support_fputil_fma",
1187 ":__support_fputil_fp_bits",
1188 ":__support_fputil_multiply_add",
1189 ":__support_fputil_nearest_integer",
1190 ":__support_fputil_polyeval",
1195 libc_support_library(
1196 name = "log_range_reduction",
1197 hdrs = ["src/math/generic/log_range_reduction.h"],
1199 ":__support_common",
1200 ":__support_fputil_dyadic_float",
1201 ":__support_uint128",
1202 ":common_constants",
1206 libc_support_library(
1207 name = "exp10f_impl",
1208 hdrs = ["src/math/generic/exp10f_impl.h"],
1210 ":__support_fputil_basic_operations",
1211 ":__support_fputil_fma",
1212 ":__support_fputil_multiply_add",
1213 ":__support_fputil_nearest_integer",
1214 ":__support_fputil_polyeval",
1215 ":__support_fputil_rounding_mode",
1216 ":__support_macros_optimization",
1217 ":common_constants",
1222 libc_support_library(
1223 name = "exp2f_impl",
1224 hdrs = ["src/math/generic/exp2f_impl.h"],
1226 ":__support_fputil_except_value_utils",
1227 ":__support_fputil_fma",
1228 ":__support_fputil_multiply_add",
1229 ":__support_fputil_nearest_integer",
1230 ":__support_fputil_polyeval",
1231 ":__support_fputil_rounding_mode",
1232 ":__support_macros_optimization",
1233 ":common_constants",
1241 ":__support_fputil_multiply_add",
1242 ":__support_fputil_polyeval",
1243 ":__support_macros_optimization",
1250 ":__support_fputil_double_double",
1251 ":__support_fputil_dyadic_float",
1252 ":__support_fputil_multiply_add",
1253 ":__support_fputil_nearest_integer",
1254 ":__support_fputil_polyeval",
1255 ":__support_fputil_rounding_mode",
1256 ":__support_fputil_triple_double",
1257 ":__support_macros_optimization",
1258 ":common_constants",
1266 ":__support_fputil_fma",
1267 ":__support_fputil_multiply_add",
1268 ":__support_fputil_nearest_integer",
1269 ":__support_fputil_polyeval",
1270 ":__support_fputil_rounding_mode",
1271 ":__support_macros_optimization",
1272 ":__support_macros_properties_cpu_features",
1273 ":common_constants",
1280 ":__support_fputil_double_double",
1281 ":__support_fputil_dyadic_float",
1282 ":__support_fputil_multiply_add",
1283 ":__support_fputil_nearest_integer",
1284 ":__support_fputil_polyeval",
1285 ":__support_fputil_rounding_mode",
1286 ":__support_fputil_triple_double",
1287 ":__support_macros_optimization",
1288 ":common_constants",
1296 ":__support_fputil_fma",
1297 ":__support_fputil_multiply_add",
1298 ":__support_fputil_nearest_integer",
1299 ":__support_fputil_polyeval",
1300 ":__support_fputil_rounding_mode",
1301 ":__support_macros_optimization",
1302 ":common_constants",
1309 ":__support_fputil_double_double",
1310 ":__support_fputil_dyadic_float",
1311 ":__support_fputil_multiply_add",
1312 ":__support_fputil_nearest_integer",
1313 ":__support_fputil_polyeval",
1314 ":__support_fputil_rounding_mode",
1315 ":__support_fputil_triple_double",
1316 ":__support_macros_optimization",
1317 ":common_constants",
1332 ":__support_fputil_double_double",
1333 ":__support_fputil_dyadic_float",
1334 ":__support_fputil_multiply_add",
1335 ":__support_fputil_nearest_integer",
1336 ":__support_fputil_polyeval",
1337 ":__support_fputil_rounding_mode",
1338 ":__support_fputil_triple_double",
1339 ":__support_macros_optimization",
1340 ":common_constants",
1355 ":__support_fputil_fma",
1356 ":__support_fputil_multiply_add",
1357 ":__support_fputil_polyeval",
1358 ":__support_macros_optimization",
1359 ":__support_macros_properties_cpu_features",
1360 ":common_constants",
1367 ":__support_fputil_fma",
1368 ":__support_fputil_multiply_add",
1369 ":__support_fputil_polyeval",
1370 ":__support_macros_optimization",
1371 ":common_constants",
1378 ":__support_fputil_fma",
1379 ":__support_fputil_multiply_add",
1380 ":__support_fputil_polyeval",
1381 ":__support_macros_optimization",
1382 ":__support_macros_properties_cpu_features",
1383 ":common_constants",
1390 ":__support_fputil_fma",
1391 ":__support_fputil_multiply_add",
1392 ":__support_fputil_polyeval",
1393 ":__support_macros_optimization",
1394 ":__support_macros_properties_cpu_features",
1395 ":common_constants",
1402 ":__support_fputil_fma",
1403 ":__support_fputil_multiply_add",
1404 ":__support_fputil_polyeval",
1405 ":__support_fputil_double_double",
1406 ":__support_fputil_dyadic_float",
1407 ":__support_macros_optimization",
1408 ":__support_macros_properties_cpu_features",
1409 ":common_constants",
1410 ":log_range_reduction",
1417 ":__support_fputil_fma",
1418 ":__support_fputil_multiply_add",
1419 ":__support_fputil_polyeval",
1420 ":__support_fputil_double_double",
1421 ":__support_fputil_dyadic_float",
1422 ":__support_macros_optimization",
1423 ":__support_macros_properties_cpu_features",
1424 ":common_constants",
1425 ":log_range_reduction",
1432 ":__support_fputil_fma",
1433 ":__support_fputil_multiply_add",
1434 ":__support_fputil_polyeval",
1435 ":__support_fputil_double_double",
1436 ":__support_fputil_dyadic_float",
1437 ":__support_macros_optimization",
1438 ":__support_macros_properties_cpu_features",
1439 ":common_constants",
1440 ":log_range_reduction",
1447 ":__support_fputil_fma",
1448 ":__support_fputil_multiply_add",
1449 ":__support_fputil_polyeval",
1450 ":__support_fputil_double_double",
1451 ":__support_fputil_dyadic_float",
1452 ":__support_macros_optimization",
1453 ":__support_macros_properties_cpu_features",
1454 ":common_constants",
1461 ":__support_fputil_fma",
1462 ":__support_fputil_multiply_add",
1463 ":__support_fputil_nearest_integer",
1464 ":__support_fputil_polyeval",
1465 ":__support_fputil_rounding_mode",
1466 ":__support_macros_optimization",
1467 ":common_constants",
1475 ":__support_fputil_fma",
1476 ":__support_fputil_multiply_add",
1477 ":__support_fputil_nearest_integer",
1478 ":__support_fputil_polyeval",
1479 ":__support_fputil_rounding_mode",
1480 ":__support_macros_optimization",
1481 ":common_constants",
1489 ":__support_fputil_fma",
1490 ":__support_fputil_multiply_add",
1491 ":__support_fputil_nearest_integer",
1492 ":__support_fputil_polyeval",
1493 ":__support_fputil_rounding_mode",
1494 ":__support_macros_optimization",
1495 ":__support_macros_properties_cpu_features",
1496 ":common_constants",
1504 ":__support_fputil_fma",
1505 ":__support_fputil_multiply_add",
1506 ":__support_fputil_nearest_integer",
1507 ":__support_fputil_polyeval",
1508 ":__support_fputil_sqrt",
1509 ":__support_macros_optimization",
1510 ":common_constants",
1518 ":__support_fputil_fma",
1519 ":__support_fputil_multiply_add",
1520 ":__support_fputil_nearest_integer",
1521 ":__support_fputil_polyeval",
1522 ":__support_fputil_sqrt",
1523 ":__support_macros_optimization",
1524 ":common_constants",
1532 ":__support_fputil_fma",
1533 ":__support_fputil_multiply_add",
1534 ":__support_fputil_nearest_integer",
1535 ":__support_fputil_polyeval",
1536 ":__support_macros_optimization",
1537 ":common_constants",
1545 ":__support_fputil_fma",
1546 ":__support_fputil_multiply_add",
1547 ":__support_fputil_nearest_integer",
1548 ":__support_fputil_polyeval",
1549 ":__support_fputil_sqrt",
1550 ":__support_macros_optimization",
1551 ":__support_macros_properties_cpu_features",
1559 ":__support_fputil_fma",
1560 ":__support_fputil_multiply_add",
1561 ":__support_fputil_nearest_integer",
1562 ":__support_fputil_polyeval",
1563 ":__support_fputil_sqrt",
1564 ":__support_macros_optimization",
1572 ":__support_fputil_fma",
1573 ":__support_fputil_multiply_add",
1574 ":__support_fputil_nearest_integer",
1575 ":__support_fputil_polyeval",
1576 ":__support_fputil_rounding_mode",
1577 ":__support_macros_optimization",
1586 ":__support_fputil_double_double",
1587 ":__support_fputil_multiply_add",
1588 ":__support_fputil_nearest_integer",
1589 ":__support_fputil_polyeval",
1590 ":__support_fputil_rounding_mode",
1591 ":__support_fputil_sqrt",
1592 ":__support_fputil_triple_double",
1593 ":__support_macros_optimization",
1594 ":common_constants",
1601 libc_math_function(name = "fabs")
1603 libc_math_function(name = "fabsf")
1605 libc_math_function(name = "fabsl")
1607 libc_math_function(name = "fdim")
1609 libc_math_function(name = "fdimf")
1611 libc_math_function(name = "fdiml")
1652 libc_math_function(name = "floorl")
1654 libc_math_function(name = "ldexp")
1656 libc_math_function(name = "ldexpf")
1658 libc_math_function(name = "ldexpl")
1676 libc_math_function(name = "truncl")
1694 libc_math_function(name = "roundl")
1699 ":__support_fputil_generic_fmod",
1706 ":__support_fputil_generic_fmod",
1710 libc_math_function(name = "frexp")
1712 libc_math_function(name = "frexpf")
1714 libc_math_function(name = "frexpl")
1716 libc_math_function(name = "hypot")
1721 ":__support_fputil_sqrt",
1725 libc_math_function(name = "logb")
1727 libc_math_function(name = "logbf")
1729 libc_math_function(name = "logbl")
1731 libc_math_function(name = "modf")
1733 libc_math_function(name = "modff")
1735 libc_math_function(name = "modfl")
1737 libc_math_function(name = "remquo")
1739 libc_math_function(name = "remquof")
1741 libc_math_function(name = "remquol")
1743 libc_math_function(name = "remainder")
1745 libc_math_function(name = "remainderf")
1747 libc_math_function(name = "remainderl")
1749 libc_math_function(name = "fmin")
1751 libc_math_function(name = "fminf")
1753 libc_math_function(name = "fminl")
1755 libc_math_function(name = "fmax")
1757 libc_math_function(name = "fmaxf")
1759 libc_math_function(name = "fmaxl")
1764 ":__support_fputil_fma",
1765 ":__support_fputil_multiply_add",
1766 ":__support_macros_optimization",
1767 ":__support_macros_properties_cpu_features",
1775 ":__support_fputil_fma",
1776 ":__support_fputil_multiply_add",
1777 ":__support_fputil_rounding_mode",
1778 ":__support_macros_optimization",
1779 ":__support_macros_properties_cpu_features",
1787 ":__support_fputil_fma",
1788 ":__support_fputil_multiply_add",
1789 ":__support_fputil_polyeval",
1790 ":__support_fputil_rounding_mode",
1791 ":__support_macros_optimization",
1792 ":__support_macros_properties_cpu_features",
1801 ":__support_fputil_fma",
1802 ":__support_fputil_multiply_add",
1803 ":__support_fputil_nearest_integer",
1804 ":__support_fputil_polyeval",
1805 ":__support_macros_optimization",
1806 ":__support_macros_properties_cpu_features",
1815 ":__support_fputil_sqrt",
1822 ":__support_fputil_sqrt",
1829 ":__support_fputil_sqrt",
1833 libc_math_function(name = "copysign")
1835 libc_math_function(name = "copysignf")
1837 libc_math_function(name = "copysignl")
1839 libc_math_function(name = "copysignf128")
1841 libc_math_function(name = "ilogb")
1843 libc_math_function(name = "ilogbf")
1845 libc_math_function(name = "ilogbl")
1847 libc_math_function(name = "rint")
1849 libc_math_function(name = "rintf")
1851 libc_math_function(name = "rintl")
1853 libc_math_function(name = "lrint")
1855 libc_math_function(name = "lrintf")
1857 libc_math_function(name = "lrintl")
1859 libc_math_function(name = "llrint")
1861 libc_math_function(name = "llrintf")
1863 libc_math_function(name = "llrintl")
1865 libc_math_function(name = "lround")
1867 libc_math_function(name = "lroundf")
1869 libc_math_function(name = "lroundl")
1871 libc_math_function(name = "llround")
1873 libc_math_function(name = "llroundf")
1875 libc_math_function(name = "llroundl")
1877 libc_math_function(name = "nearbyint")
1879 libc_math_function(name = "nearbyintf")
1881 libc_math_function(name = "nearbyintl")
1883 libc_math_function(name = "nextafter")
1885 libc_math_function(name = "nextafterf")
1887 libc_math_function(name = "nextafterl")
1889 libc_math_function(name = "nexttoward")
1891 libc_math_function(name = "nexttowardf")
1893 libc_math_function(name = "nexttowardl")
1895 libc_math_function(name = "scalbn")
1897 libc_math_function(name = "scalbnf")
1899 libc_math_function(name = "scalbnl")
1901 ############################## inttypes targets ##############################
1905 srcs = ["src/inttypes/imaxabs.cpp"],
1906 hdrs = ["src/inttypes/imaxabs.h"],
1908 ":__support_common",
1909 ":__support_integer_operations",
1915 srcs = ["src/inttypes/imaxdiv.cpp"],
1916 hdrs = ["src/inttypes/imaxdiv.h"],
1918 ":__support_common",
1919 ":__support_integer_operations",
1923 ############################### stdlib targets ###############################
1927 srcs = ["src/stdlib/abs.cpp"],
1928 hdrs = ["src/stdlib/abs.h"],
1930 ":__support_common",
1931 ":__support_integer_operations",
1937 srcs = ["src/stdlib/labs.cpp"],
1938 hdrs = ["src/stdlib/labs.h"],
1940 ":__support_common",
1941 ":__support_integer_operations",
1947 srcs = ["src/stdlib/llabs.cpp"],
1948 hdrs = ["src/stdlib/llabs.h"],
1950 ":__support_common",
1951 ":__support_integer_operations",
1957 srcs = ["src/stdlib/div.cpp"],
1958 hdrs = ["src/stdlib/div.h"],
1960 ":__support_common",
1961 ":__support_integer_operations",
1967 srcs = ["src/stdlib/ldiv.cpp"],
1968 hdrs = ["src/stdlib/ldiv.h"],
1970 ":__support_common",
1971 ":__support_integer_operations",
1977 srcs = ["src/stdlib/lldiv.cpp"],
1978 hdrs = ["src/stdlib/lldiv.h"],
1980 ":__support_common",
1981 ":__support_integer_operations",
1987 srcs = ["src/stdlib/atoi.cpp"],
1988 hdrs = ["src/stdlib/atoi.h"],
1990 ":__support_common",
1991 ":__support_str_to_integer",
1998 srcs = ["src/stdlib/atol.cpp"],
1999 hdrs = ["src/stdlib/atol.h"],
2001 ":__support_common",
2002 ":__support_str_to_integer",
2009 srcs = ["src/stdlib/atoll.cpp"],
2010 hdrs = ["src/stdlib/atoll.h"],
2012 ":__support_common",
2013 ":__support_str_to_integer",
2020 srcs = ["src/stdlib/atof.cpp"],
2021 hdrs = ["src/stdlib/atof.h"],
2023 ":__support_common",
2024 ":__support_str_to_float",
2031 srcs = ["src/stdlib/bsearch.cpp"],
2032 hdrs = ["src/stdlib/bsearch.h"],
2034 ":__support_common",
2038 libc_support_library(
2039 name = "qsort_util",
2040 hdrs = ["src/stdlib/qsort_util.h"],
2042 ":__support_common",
2043 ":__support_macros_attributes",
2049 srcs = ["src/stdlib/qsort.cpp"],
2050 hdrs = ["src/stdlib/qsort.h"],
2052 ":__support_common",
2059 srcs = ["src/stdlib/qsort_r.cpp"],
2060 hdrs = ["src/stdlib/qsort_r.h"],
2062 ":__support_common",
2069 srcs = ["src/stdlib/strtol.cpp"],
2070 hdrs = ["src/stdlib/strtol.h"],
2072 ":__support_common",
2073 ":__support_str_to_integer",
2080 srcs = ["src/stdlib/strtoll.cpp"],
2081 hdrs = ["src/stdlib/strtoll.h"],
2083 ":__support_common",
2084 ":__support_str_to_integer",
2091 srcs = ["src/stdlib/strtoul.cpp"],
2092 hdrs = ["src/stdlib/strtoul.h"],
2094 ":__support_common",
2095 ":__support_str_to_integer",
2102 srcs = ["src/stdlib/strtoull.cpp"],
2103 hdrs = ["src/stdlib/strtoull.h"],
2105 ":__support_common",
2106 ":__support_str_to_integer",
2113 srcs = ["src/stdlib/strtof.cpp"],
2114 hdrs = ["src/stdlib/strtof.h"],
2116 ":__support_common",
2117 ":__support_str_to_float",
2124 srcs = ["src/stdlib/strtod.cpp"],
2125 hdrs = ["src/stdlib/strtod.h"],
2127 ":__support_common",
2128 ":__support_str_to_float",
2135 srcs = ["src/stdlib/strtold.cpp"],
2136 hdrs = ["src/stdlib/strtold.h"],
2138 ":__support_common",
2139 ":__support_str_to_float",
2144 ############################### string targets ###############################
2146 no_sanitize_features = [
2153 libc_support_library(
2154 name = "string_memory_utils",
2156 "src/string/memory_utils/op_aarch64.h",
2157 "src/string/memory_utils/op_builtin.h",
2158 "src/string/memory_utils/op_generic.h",
2159 "src/string/memory_utils/op_riscv.h",
2160 "src/string/memory_utils/op_x86.h",
2161 "src/string/memory_utils/utils.h",
2163 defines = MEMORY_COPTS,
2165 "src/string/memory_utils/aarch64/inline_bcmp.h",
2166 "src/string/memory_utils/aarch64/inline_memcmp.h",
2167 "src/string/memory_utils/aarch64/inline_memcpy.h",
2168 "src/string/memory_utils/aarch64/inline_memmove.h",
2169 "src/string/memory_utils/aarch64/inline_memset.h",
2170 "src/string/memory_utils/generic/aligned_access.h",
2171 "src/string/memory_utils/generic/byte_per_byte.h",
2172 "src/string/memory_utils/inline_bcmp.h",
2173 "src/string/memory_utils/inline_bzero.h",
2174 "src/string/memory_utils/inline_memcmp.h",
2175 "src/string/memory_utils/inline_memcpy.h",
2176 "src/string/memory_utils/inline_memmem.h",
2177 "src/string/memory_utils/inline_memmove.h",
2178 "src/string/memory_utils/inline_memset.h",
2179 "src/string/memory_utils/inline_strcmp.h",
2180 "src/string/memory_utils/inline_strstr.h",
2181 "src/string/memory_utils/riscv/inline_bcmp.h",
2182 "src/string/memory_utils/riscv/inline_memcmp.h",
2183 "src/string/memory_utils/riscv/inline_memcpy.h",
2184 "src/string/memory_utils/riscv/inline_memmove.h",
2185 "src/string/memory_utils/riscv/inline_memset.h",
2186 "src/string/memory_utils/x86_64/inline_bcmp.h",
2187 "src/string/memory_utils/x86_64/inline_memcmp.h",
2188 "src/string/memory_utils/x86_64/inline_memcpy.h",
2189 "src/string/memory_utils/x86_64/inline_memmove.h",
2190 "src/string/memory_utils/x86_64/inline_memset.h",
2193 ":__support_common",
2194 ":__support_cpp_array",
2195 ":__support_cpp_bit",
2196 ":__support_cpp_cstddef",
2197 ":__support_cpp_type_traits",
2198 ":__support_macros_attributes",
2199 ":__support_macros_config",
2200 ":__support_macros_optimization",
2201 ":__support_macros_properties_architectures",
2202 ":__support_macros_properties_cpu_features",
2206 libc_support_library(
2207 name = "string_utils",
2208 hdrs = ["src/string/string_utils.h"],
2210 ":__support_common",
2211 ":__support_cpp_bitset",
2212 ":__support_macros_optimization",
2213 ":string_memory_utils",
2219 srcs = ["src/string/memchr.cpp"],
2220 hdrs = ["src/string/memchr.h"],
2222 ":__support_common",
2229 srcs = ["src/string/memcpy.cpp"],
2230 hdrs = ["src/string/memcpy.h"],
2231 copts = ["-mllvm --tail-merge-threshold=0"],
2232 features = no_sanitize_features,
2235 ":__support_common",
2236 ":string_memory_utils",
2242 srcs = ["src/string/memset.cpp"],
2243 hdrs = ["src/string/memset.h"],
2244 features = no_sanitize_features,
2247 ":__support_common",
2248 ":string_memory_utils",
2254 srcs = ["src/string/memmove.cpp"],
2255 hdrs = ["src/string/memmove.h"],
2256 features = no_sanitize_features,
2259 ":__support_common",
2260 ":string_memory_utils",
2266 srcs = ["src/string/mempcpy.cpp"],
2267 hdrs = ["src/string/mempcpy.h"],
2268 copts = ["-mllvm --tail-merge-threshold=0"],
2269 features = no_sanitize_features,
2272 ":__support_common",
2273 ":string_memory_utils",
2279 srcs = ["src/string/bcopy.cpp"],
2280 hdrs = ["src/string/bcopy.h"],
2281 features = no_sanitize_features,
2283 ":__support_common",
2284 ":string_memory_utils",
2290 srcs = ["src/string/memcmp.cpp"],
2291 hdrs = ["src/string/memcmp.h"],
2292 features = no_sanitize_features,
2295 ":__support_common",
2296 ":__support_integer_operations",
2297 ":string_memory_utils",
2303 srcs = ["src/string/bcmp.cpp"],
2304 hdrs = ["src/string/bcmp.h"],
2305 features = no_sanitize_features,
2308 ":__support_common",
2309 ":string_memory_utils",
2315 srcs = ["src/string/bzero.cpp"],
2316 hdrs = ["src/string/bzero.h"],
2317 features = no_sanitize_features,
2320 ":__support_common",
2321 ":string_memory_utils",
2327 srcs = ["src/string/memrchr.cpp"],
2328 hdrs = ["src/string/memrchr.h"],
2330 ":__support_common",
2337 srcs = ["src/string/strlen.cpp"],
2338 hdrs = ["src/string/strlen.h"],
2339 features = no_sanitize_features,
2341 ":__support_common",
2348 srcs = ["src/string/strcpy.cpp"],
2349 hdrs = ["src/string/strcpy.h"],
2350 features = no_sanitize_features,
2352 ":__support_common",
2354 ":string_memory_utils",
2359 # A sanitizer instrumented flavor of strcpy to be used with unittests.
2361 name = "strcpy_sanitized",
2363 srcs = ["src/string/strcpy.cpp"],
2364 hdrs = ["src/string/strcpy.h"],
2366 ":__support_common",
2368 ":string_memory_utils",
2375 srcs = ["src/string/strncpy.cpp"],
2376 hdrs = ["src/string/strncpy.h"],
2378 ":__support_common",
2384 srcs = ["src/string/strcmp.cpp"],
2385 hdrs = ["src/string/strcmp.h"],
2387 ":__support_common",
2388 ":string_memory_utils",
2395 srcs = ["src/string/strchr.cpp"],
2396 hdrs = ["src/string/strchr.h"],
2398 ":__support_common",
2405 srcs = ["src/string/strrchr.cpp"],
2406 hdrs = ["src/string/strrchr.h"],
2408 ":__support_common",
2415 srcs = ["src/string/strstr.cpp"],
2416 hdrs = ["src/string/strstr.h"],
2418 ":__support_common",
2419 ":string_memory_utils",
2426 srcs = ["src/string/strnlen.cpp"],
2427 hdrs = ["src/string/strnlen.h"],
2429 ":__support_common",
2436 srcs = ["src/string/strcspn.cpp"],
2437 hdrs = ["src/string/strcspn.h"],
2439 ":__support_common",
2446 srcs = ["src/string/strspn.cpp"],
2447 hdrs = ["src/string/strspn.h"],
2449 ":__support_common",
2450 ":__support_cpp_bitset",
2457 srcs = ["src/string/strpbrk.cpp"],
2458 hdrs = ["src/string/strpbrk.h"],
2460 ":__support_common",
2467 srcs = ["src/string/strtok.cpp"],
2468 hdrs = ["src/string/strtok.h"],
2470 ":__support_common",
2475 ############################### unistd targets ###############################
2479 srcs = ["src/unistd/linux/chdir.cpp"],
2480 hdrs = ["src/unistd/chdir.h"],
2482 ":__support_common",
2483 ":__support_osutil_syscall",
2490 srcs = ["src/unistd/linux/close.cpp"],
2491 hdrs = ["src/unistd/close.h"],
2493 ":__support_common",
2494 ":__support_osutil_syscall",
2501 srcs = ["src/unistd/linux/fchdir.cpp"],
2502 hdrs = ["src/unistd/fchdir.h"],
2504 ":__support_common",
2505 ":__support_osutil_syscall",
2512 srcs = ["src/unistd/linux/fsync.cpp"],
2513 hdrs = ["src/unistd/fsync.h"],
2515 ":__support_common",
2516 ":__support_osutil_syscall",
2523 srcs = ["src/unistd/linux/ftruncate.cpp"],
2524 hdrs = ["src/unistd/ftruncate.h"],
2526 ":__support_common",
2527 ":__support_osutil_syscall",
2534 srcs = ["src/unistd/linux/link.cpp"],
2535 hdrs = ["src/unistd/link.h"],
2537 ":__support_common",
2538 ":__support_osutil_syscall",
2545 srcs = ["src/unistd/linux/linkat.cpp"],
2546 hdrs = ["src/unistd/linkat.h"],
2548 ":__support_common",
2549 ":__support_osutil_syscall",
2556 srcs = ["src/unistd/linux/lseek.cpp"],
2557 hdrs = ["src/unistd/lseek.h"],
2559 ":__support_common",
2560 ":__support_file_linux_lseekimpl",
2561 ":__support_osutil_syscall",
2568 srcs = ["src/unistd/linux/read.cpp"],
2569 hdrs = ["src/unistd/read.h"],
2571 ":__support_common",
2572 ":__support_osutil_syscall",
2579 srcs = ["src/unistd/linux/readlink.cpp"],
2580 hdrs = ["src/unistd/readlink.h"],
2582 ":__support_common",
2583 ":__support_osutil_syscall",
2589 name = "readlinkat",
2590 srcs = ["src/unistd/linux/readlinkat.cpp"],
2591 hdrs = ["src/unistd/readlinkat.h"],
2593 ":__support_common",
2594 ":__support_osutil_syscall",
2601 srcs = ["src/unistd/linux/rmdir.cpp"],
2602 hdrs = ["src/unistd/rmdir.h"],
2604 ":__support_common",
2605 ":__support_osutil_syscall",
2612 srcs = ["src/unistd/linux/symlink.cpp"],
2613 hdrs = ["src/unistd/symlink.h"],
2615 ":__support_common",
2616 ":__support_osutil_syscall",
2623 srcs = ["src/unistd/linux/symlinkat.cpp"],
2624 hdrs = ["src/unistd/symlinkat.h"],
2626 ":__support_common",
2627 ":__support_osutil_syscall",
2634 srcs = ["src/unistd/linux/truncate.cpp"],
2635 hdrs = ["src/unistd/truncate.h"],
2637 ":__support_common",
2638 ":__support_osutil_syscall",
2645 srcs = ["src/unistd/linux/unlink.cpp"],
2646 hdrs = ["src/unistd/unlink.h"],
2648 ":__support_common",
2649 ":__support_osutil_syscall",
2656 srcs = ["src/unistd/linux/unlinkat.cpp"],
2657 hdrs = ["src/unistd/unlinkat.h"],
2659 ":__support_common",
2660 ":__support_osutil_syscall",
2667 srcs = ["src/unistd/linux/write.cpp"],
2668 hdrs = ["src/unistd/write.h"],
2670 ":__support_common",
2671 ":__support_osutil_syscall",
2676 ################################ stdio targets #################################
2678 libc_support_library(
2679 name = "printf_core_structs",
2680 hdrs = ["src/stdio/printf_core/core_structs.h"],
2681 defines = PRINTF_COPTS,
2683 ":__support_cpp_string_view",
2684 ":__support_fputil_fp_bits",
2688 libc_support_library(
2689 name = "printf_config",
2690 hdrs = ["src/stdio/printf_core/printf_config.h"],
2691 defines = PRINTF_COPTS,
2696 libc_support_library(
2697 name = "printf_parser",
2698 hdrs = ["src/stdio/printf_core/parser.h"],
2699 defines = PRINTF_COPTS,
2701 ":__support_arg_list",
2702 ":__support_common",
2703 ":__support_cpp_bit",
2704 ":__support_cpp_optional",
2705 ":__support_cpp_string_view",
2706 ":__support_cpp_type_traits",
2707 ":__support_ctype_utils",
2708 ":__support_fputil_fp_bits",
2709 ":__support_str_to_integer",
2711 ":printf_core_structs",
2715 # Only used for testing.
2716 libc_support_library(
2717 name = "printf_mock_parser",
2718 hdrs = ["src/stdio/printf_core/parser.h"],
2719 defines = PRINTF_COPTS + ["LIBC_COPT_MOCK_ARG_LIST"],
2721 ":__support_arg_list",
2722 ":__support_common",
2723 ":__support_cpp_bit",
2724 ":__support_cpp_optional",
2725 ":__support_cpp_string_view",
2726 ":__support_cpp_type_traits",
2727 ":__support_ctype_utils",
2728 ":__support_fputil_fp_bits",
2729 ":__support_str_to_integer",
2731 ":printf_core_structs",
2735 libc_support_library(
2736 name = "printf_writer",
2737 srcs = ["src/stdio/printf_core/writer.cpp"],
2738 hdrs = ["src/stdio/printf_core/writer.h"],
2739 defines = PRINTF_COPTS,
2741 ":__support_cpp_string_view",
2742 ":__support_macros_optimization",
2743 ":printf_core_structs",
2744 ":string_memory_utils",
2748 libc_support_library(
2749 name = "printf_converter",
2750 srcs = ["src/stdio/printf_core/converter.cpp"],
2752 "src/stdio/printf_core/char_converter.h",
2753 "src/stdio/printf_core/converter.h",
2754 "src/stdio/printf_core/converter_atlas.h",
2755 "src/stdio/printf_core/converter_utils.h",
2756 "src/stdio/printf_core/float_dec_converter.h",
2757 "src/stdio/printf_core/float_hex_converter.h",
2758 "src/stdio/printf_core/float_inf_nan_converter.h",
2759 "src/stdio/printf_core/int_converter.h",
2760 "src/stdio/printf_core/ptr_converter.h",
2761 "src/stdio/printf_core/string_converter.h",
2762 "src/stdio/printf_core/write_int_converter.h",
2764 defines = PRINTF_COPTS,
2766 ":__support_common",
2767 ":__support_cpp_limits",
2768 ":__support_cpp_span",
2769 ":__support_cpp_string_view",
2770 ":__support_float_to_string",
2771 ":__support_fputil_fenv_impl",
2772 ":__support_fputil_fp_bits",
2773 ":__support_fputil_rounding_mode",
2774 ":__support_integer_to_string",
2775 ":__support_libc_assert",
2777 ":__support_uint128",
2778 ":printf_core_structs",
2783 libc_support_library(
2784 name = "printf_main",
2785 srcs = ["src/stdio/printf_core/printf_main.cpp"],
2786 hdrs = ["src/stdio/printf_core/printf_main.h"],
2787 defines = PRINTF_COPTS,
2789 ":__support_arg_list",
2790 ":printf_converter",
2791 ":printf_core_structs",
2797 libc_support_library(
2798 name = "vfprintf_internal",
2799 hdrs = ["src/stdio/printf_core/vfprintf_internal.h"],
2800 defines = PRINTF_COPTS,
2802 ":__support_arg_list",
2803 ":__support_file_file",
2804 ":__support_macros_attributes",
2812 srcs = ["src/stdio/sprintf.cpp"],
2813 hdrs = ["src/stdio/sprintf.h"],
2814 defines = PRINTF_COPTS,
2816 ":__support_arg_list",
2817 ":__support_cpp_limits",
2826 srcs = ["src/stdio/snprintf.cpp"],
2827 hdrs = ["src/stdio/snprintf.h"],
2828 defines = PRINTF_COPTS,
2830 ":__support_arg_list",
2839 srcs = ["src/stdio/printf.cpp"],
2840 hdrs = ["src/stdio/printf.h"],
2841 defines = PRINTF_COPTS,
2843 ":__support_arg_list",
2844 ":__support_file_file",
2846 ":vfprintf_internal",
2852 srcs = ["src/stdio/fprintf.cpp"],
2853 hdrs = ["src/stdio/fprintf.h"],
2854 defines = PRINTF_COPTS,
2856 ":__support_arg_list",
2857 ":__support_file_file",
2859 ":vfprintf_internal",
2865 srcs = ["src/stdio/vsprintf.cpp"],
2866 hdrs = ["src/stdio/vsprintf.h"],
2867 defines = PRINTF_COPTS,
2869 ":__support_arg_list",
2870 ":__support_cpp_limits",
2879 srcs = ["src/stdio/vsnprintf.cpp"],
2880 hdrs = ["src/stdio/vsnprintf.h"],
2881 defines = PRINTF_COPTS,
2883 ":__support_arg_list",
2892 srcs = ["src/stdio/vprintf.cpp"],
2893 hdrs = ["src/stdio/vprintf.h"],
2894 defines = PRINTF_COPTS,
2896 ":__support_arg_list",
2897 ":__support_file_file",
2899 ":vfprintf_internal",
2905 srcs = ["src/stdio/vfprintf.cpp"],
2906 hdrs = ["src/stdio/vfprintf.h"],
2907 defines = PRINTF_COPTS,
2909 ":__support_arg_list",
2910 ":__support_file_file",
2912 ":vfprintf_internal",