Debian Codegraph @

utils/bazel/llvm-project-overlay/libc/BUILD.bazel

raw
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
4
5 # LLVM libc project.
6 load("@bazel_skylib//lib:selects.bzl", "selects")
7 load("@bazel_skylib//rules:common_settings.bzl", "string_flag")
8 load("@rules_python//python:defs.bzl", "py_binary")
9 load(
10 ":libc_build_rules.bzl",
11 "libc_function",
12 "libc_generated_header",
13 "libc_header_library",
14 "libc_math_function",
15 "libc_support_library",
16 )
17 load(":platforms.bzl", "PLATFORM_CPU_ARM64", "PLATFORM_CPU_X86_64")
18
19 package(
20 default_visibility = ["//visibility:public"],
21 features = [
22 "-use_header_modules",
23 "-layering_check",
24 ],
25 )
26
27 licenses(["notice"])
28
29 # A flag to pick which `mpfr` to use for math tests.
30 # Usage: `--@llvm-project//libc:mpfr=<disable|external|system>`.
31 # Flag documentation: https://bazel.build/extending/config
32 string_flag(
33 name = "mpfr",
34 build_setting_default = "external",
35 values = [
36 "disable", # Skip tests that need mpfr
37 "external", # Build mpfr from source
38 "system", # Use system mpfr (non hermetic)
39 ],
40 )
41
42 config_setting(
43 name = "mpfr_disable",
44 flag_values = {":mpfr": "disable"},
45 )
46
47 config_setting(
48 name = "mpfr_external",
49 flag_values = {":mpfr": "external"},
50 )
51
52 config_setting(
53 name = "mpfr_system",
54 flag_values = {":mpfr": "system"},
55 )
56
57 # A flag to pick which `mpc` to use for math tests.
58 # Usage: `--@llvm-project//libc:mpc=<disable|external|system>`.
59 # Flag documentation: https://bazel.build/extending/config
60 string_flag(
61 name = "mpc",
62 build_setting_default = "external",
63 values = [
64 "disable", # Skip tests that need mpc
65 "external", # Build mpc from source
66 "system", # Use system mpc (non hermetic)
67 ],
68 )
69
70 config_setting(
71 name = "mpc_disable",
72 flag_values = {":mpc": "disable"},
73 )
74
75 config_setting(
76 name = "mpc_external",
77 flag_values = {":mpc": "external"},
78 )
79
80 config_setting(
81 name = "mpc_system",
82 flag_values = {":mpc": "system"},
83 )
84
85 ########################### Header Generation ##################################
86
87 py_binary(
88 name = "hdrgen",
89 srcs = glob(["utils/hdrgen/hdrgen/**/*.py"]),
90 imports = ["utils/hdrgen"],
91 main = "utils/hdrgen/hdrgen/main.py",
92 deps = ["@pyyaml//:yaml"],
93 )
94
95 libc_generated_header(
96 name = "include_stdbit_h",
97 hdr = "staging/include/stdbit.h",
98 other_srcs = ["include/stdbit.h.def"],
99 yaml_template = "include/stdbit.yaml",
100 )
101
102 # Library containing all headers that can be transitively included by generated llvm-libc
103 # public headers (or by the unit tests).
104 libc_support_library(
105 name = "public_headers_deps",
106 textual_hdrs = [
107 "include/__llvm-libc-common.h",
108 ] + glob([
109 "include/llvm-libc-types/**/*.h",
110 "include/llvm-libc-macros/**/*.h",
111 ]),
112 )
113
114 ################################## Base Config #################################
115
116 libc_support_library(
117 name = "__support_macros_config",
118 hdrs = ["src/__support/macros/config.h"],
119 )
120
121 ################################# Include Files ################################
122
123 libc_support_library(
124 name = "llvm_libc_macros_math_macros",
125 hdrs = ["include/llvm-libc-macros/math-macros.h"],
126 deps = [":llvm_libc_macros_limits_macros"],
127 )
128
129 libc_support_library(
130 name = "llvm_libc_macros_limits_macros",
131 hdrs = ["include/llvm-libc-macros/limits-macros.h"],
132 )
133
134 libc_support_library(
135 name = "llvm_libc_macros_float_macros",
136 hdrs = ["include/llvm-libc-macros/float-macros.h"],
137 )
138
139 libc_support_library(
140 name = "llvm_libc_macros_float16_macros",
141 hdrs = ["include/llvm-libc-macros/float16-macros.h"],
142 deps = [":llvm_libc_types_float128"],
143 )
144
145 libc_support_library(
146 name = "llvm_libc_macros_stdint_macros",
147 hdrs = ["include/llvm-libc-macros/stdint-macros.h"],
148 )
149
150 libc_support_library(
151 name = "llvm_libc_macros_stdfix_macros",
152 hdrs = ["include/llvm-libc-macros/stdfix-macros.h"],
153 deps = [":llvm_libc_macros_float_macros"],
154 )
155
156 libc_support_library(
157 name = "llvm_libc_types_float128",
158 hdrs = ["include/llvm-libc-types/float128.h"],
159 target_compatible_with = select({
160 "@platforms//os:linux": [],
161 "//conditions:default": ["@platforms//:incompatible"],
162 }),
163 deps = [":llvm_libc_macros_float_macros"],
164 )
165
166 libc_support_library(
167 name = "llvm_libc_types_cfloat128",
168 hdrs = ["include/llvm-libc-types/cfloat128.h"],
169 deps = [":llvm_libc_macros_float_macros"],
170 )
171
172 libc_support_library(
173 name = "llvm_libc_types_cfloat16",
174 hdrs = ["include/llvm-libc-types/cfloat16.h"],
175 )
176
177 libc_support_library(
178 name = "llvm_libc_macros_fcntl_macros",
179 hdrs = ["include/llvm-libc-macros/linux/fcntl-macros.h"],
180 )
181
182 libc_support_library(
183 name = "llvm_libc_types_size_t",
184 hdrs = ["include/llvm-libc-types/size_t.h"],
185 )
186
187 ########################### Macro Proxy Header Files ###########################
188
189 libc_support_library(
190 name = "hdr_math_macros",
191 hdrs = ["hdr/math_macros.h"],
192 )
193
194 libc_support_library(
195 name = "hdr_fenv_macros",
196 hdrs = ["hdr/fenv_macros.h"],
197 )
198
199 libc_support_library(
200 name = "hdr_fcntl_macros",
201 hdrs = ["hdr/fcntl_macros.h"],
202 deps = [":hdr_fcntl_overlay"],
203 )
204
205 libc_support_library(
206 name = "hdr_fcntl_overlay",
207 hdrs = ["hdr/fcntl_overlay.h"],
208 )
209
210 libc_support_library(
211 name = "hdr_signal_macros",
212 hdrs = ["hdr/signal_macros.h"],
213 )
214
215 libc_support_library(
216 name = "hdr_sys_epoll_macros",
217 hdrs = ["hdr/sys_epoll_macros.h"],
218 )
219
220 libc_support_library(
221 name = "hdr_errno_macros",
222 hdrs = ["hdr/errno_macros.h"],
223 )
224
225 libc_support_library(
226 name = "hdr_time_macros",
227 hdrs = ["hdr/time_macros.h"],
228 )
229
230 libc_support_library(
231 name = "hdr_float_macros",
232 hdrs = ["hdr/float_macros.h"],
233 )
234
235 libc_support_library(
236 name = "hdr_stdio_macros",
237 hdrs = ["hdr/stdio_macros.h"],
238 deps = [
239 ":hdr_stdio_overlay",
240 ],
241 )
242
243 libc_support_library(
244 name = "hdr_unistd_macros",
245 hdrs = ["hdr/unistd_macros.h"],
246 deps = [
247 ":hdr_unistd_overlay",
248 ],
249 )
250
251 libc_support_library(
252 name = "hdr_limits_macros",
253 hdrs = ["hdr/limits_macros.h"],
254 )
255
256 libc_support_library(
257 name = "hdr_stdio_overlay",
258 hdrs = ["hdr/stdio_overlay.h"],
259 )
260
261 libc_support_library(
262 name = "hdr_stdlib_overlay",
263 hdrs = ["hdr/stdlib_overlay.h"],
264 )
265
266 libc_support_library(
267 name = "hdr_unistd_overlay",
268 hdrs = ["hdr/unistd_overlay.h"],
269 )
270
271 libc_support_library(
272 name = "hdr_wchar_macros",
273 hdrs = ["hdr/wchar_macros.h"],
274 deps = [
275 ":hdr_wchar_overlay",
276 ],
277 )
278
279 libc_support_library(
280 name = "hdr_wchar_overlay",
281 hdrs = ["hdr/wchar_overlay.h"],
282 )
283
284 ############################ Type Proxy Header Files ###########################
285
286 libc_support_library(
287 name = "func_aligned_alloc",
288 hdrs = ["hdr/func/aligned_alloc.h"],
289 deps = [":hdr_stdlib_overlay"],
290 )
291
292 libc_support_library(
293 name = "func_free",
294 hdrs = ["hdr/func/free.h"],
295 deps = [":hdr_stdlib_overlay"],
296 )
297
298 libc_support_library(
299 name = "func_malloc",
300 hdrs = ["hdr/func/malloc.h"],
301 deps = [":hdr_stdlib_overlay"],
302 )
303
304 libc_support_library(
305 name = "func_realloc",
306 hdrs = ["hdr/func/realloc.h"],
307 deps = [":hdr_stdlib_overlay"],
308 )
309
310 libc_support_library(
311 name = "types_clockid_t",
312 hdrs = ["hdr/types/clockid_t.h"],
313 )
314
315 libc_support_library(
316 name = "types_clock_t",
317 hdrs = ["hdr/types/clock_t.h"],
318 )
319
320 libc_support_library(
321 name = "types_div_t",
322 hdrs = ["hdr/types/div_t.h"],
323 deps = [":hdr_stdlib_overlay"],
324 )
325
326 libc_support_library(
327 name = "types_fenv_t",
328 hdrs = ["hdr/types/fenv_t.h"],
329 )
330
331 libc_support_library(
332 name = "types_fexcept_t",
333 hdrs = ["hdr/types/fexcept_t.h"],
334 )
335
336 libc_support_library(
337 name = "types_ldiv_t",
338 hdrs = ["hdr/types/ldiv_t.h"],
339 deps = [":hdr_stdlib_overlay"],
340 )
341
342 libc_support_library(
343 name = "types_lldiv_t",
344 hdrs = ["hdr/types/lldiv_t.h"],
345 deps = [":hdr_stdlib_overlay"],
346 )
347
348 libc_support_library(
349 name = "types_mode_t",
350 hdrs = ["hdr/types/mode_t.h"],
351 deps = [":hdr_fcntl_overlay"],
352 )
353
354 libc_support_library(
355 name = "types_sigset_t",
356 hdrs = ["hdr/types/sigset_t.h"],
357 )
358
359 libc_support_library(
360 name = "types_size_t",
361 hdrs = ["hdr/types/size_t.h"],
362 )
363
364 libc_support_library(
365 name = "types_struct_epoll_event",
366 hdrs = ["hdr/types/struct_epoll_event.h"],
367 )
368
369 libc_support_library(
370 name = "types_struct_f_owner_ex",
371 hdrs = ["hdr/types/struct_f_owner_ex.h"],
372 deps = [":hdr_fcntl_overlay"],
373 )
374
375 libc_support_library(
376 name = "types_struct_flock",
377 hdrs = ["hdr/types/struct_flock.h"],
378 deps = [":hdr_fcntl_overlay"],
379 )
380
381 libc_support_library(
382 name = "types_struct_flock64",
383 hdrs = ["hdr/types/struct_flock64.h"],
384 deps = [":hdr_fcntl_overlay"],
385 )
386
387 libc_support_library(
388 name = "types_struct_timespec",
389 hdrs = ["hdr/types/struct_timespec.h"],
390 )
391
392 libc_support_library(
393 name = "types_time_t",
394 hdrs = ["hdr/types/time_t.h"],
395 )
396
397 libc_support_library(
398 name = "types_struct_timeval",
399 hdrs = ["hdr/types/struct_timeval.h"],
400 )
401
402 libc_support_library(
403 name = "types_pid_t",
404 hdrs = ["hdr/types/pid_t.h"],
405 )
406
407 libc_support_library(
408 name = "types_uid_t",
409 hdrs = ["hdr/types/uid_t.h"],
410 )
411
412 libc_support_library(
413 name = "types_off_t",
414 hdrs = ["hdr/types/off_t.h"],
415 deps = [
416 ":hdr_stdio_overlay",
417 ],
418 )
419
420 libc_support_library(
421 name = "types_FILE",
422 hdrs = ["hdr/types/FILE.h"],
423 deps = [
424 ":hdr_stdio_overlay",
425 ],
426 )
427
428 libc_support_library(
429 name = "types_ssize_t",
430 hdrs = ["hdr/types/ssize_t.h"],
431 )
432
433 libc_support_library(
434 name = "types_socklen_t",
435 hdrs = ["hdr/types/socklen_t.h"],
436 )
437
438 libc_support_library(
439 name = "types_struct_sockaddr",
440 hdrs = ["hdr/types/struct_sockaddr.h"],
441 )
442
443 libc_support_library(
444 name = "types_struct_msghdr",
445 hdrs = ["hdr/types/struct_msghdr.h"],
446 )
447
448 libc_support_library(
449 name = "types_wchar_t",
450 hdrs = ["hdr/types/wchar_t.h"],
451 deps = [
452 ":hdr_wchar_overlay",
453 ],
454 )
455
456 libc_support_library(
457 name = "types_wint_t",
458 hdrs = ["hdr/types/wint_t.h"],
459 deps = [
460 ":hdr_wchar_overlay",
461 ],
462 )
463
464 ############################### Support libraries ##############################
465
466 libc_support_library(
467 name = "__support_macros_properties_architectures",
468 hdrs = ["src/__support/macros/properties/architectures.h"],
469 )
470
471 libc_support_library(
472 name = "__support_macros_properties_compiler",
473 hdrs = ["src/__support/macros/properties/compiler.h"],
474 )
475
476 libc_support_library(
477 name = "__support_macros_properties_os",
478 hdrs = ["src/__support/macros/properties/os.h"],
479 )
480
481 libc_support_library(
482 name = "__support_macros_properties_complex_types",
483 hdrs = ["src/__support/macros/properties/complex_types.h"],
484 deps = [
485 ":__support_macros_properties_types",
486 ":llvm_libc_types_cfloat128",
487 ":llvm_libc_types_cfloat16",
488 ],
489 )
490
491 libc_support_library(
492 name = "__support_macros_properties_types",
493 hdrs = ["src/__support/macros/properties/types.h"],
494 deps = [
495 ":__support_macros_config",
496 ":__support_macros_properties_architectures",
497 ":__support_macros_properties_compiler",
498 ":__support_macros_properties_cpu_features",
499 ":__support_macros_properties_os",
500 ":hdr_float_macros",
501 ":llvm_libc_macros_float16_macros",
502 ":llvm_libc_types_float128",
503 ],
504 )
505
506 libc_support_library(
507 name = "__support_macros_properties_cpu_features",
508 hdrs = ["src/__support/macros/properties/cpu_features.h"],
509 deps = [
510 "__support_macros_properties_architectures",
511 ],
512 )
513
514 libc_support_library(
515 name = "__support_macros_attributes",
516 hdrs = ["src/__support/macros/attributes.h"],
517 deps = [
518 ":__support_macros_properties_architectures",
519 ],
520 )
521
522 libc_support_library(
523 name = "__support_macros_optimization",
524 hdrs = ["src/__support/macros/optimization.h"],
525 deps = [
526 ":__support_macros_attributes",
527 ":__support_macros_config",
528 ":__support_macros_properties_compiler",
529 ],
530 )
531
532 libc_support_library(
533 name = "__support_macros_sanitizer",
534 hdrs = ["src/__support/macros/sanitizer.h"],
535 deps = [
536 ":__support_macros_config",
537 ],
538 )
539
540 libc_support_library(
541 name = "__support_macros_null_check",
542 hdrs = ["src/__support/macros/null_check.h"],
543 deps = [
544 ":__support_macros_config",
545 ":__support_macros_optimization",
546 ":__support_macros_sanitizer",
547 ],
548 )
549
550 libc_support_library(
551 name = "__support_common",
552 hdrs = [
553 "src/__support/common.h",
554 "src/__support/endian_internal.h",
555 ],
556 deps = [
557 ":__support_macros_attributes",
558 ":__support_macros_config",
559 ":__support_macros_properties_architectures",
560 ],
561 )
562
563 libc_support_library(
564 name = "__support_cpp_algorithm",
565 hdrs = ["src/__support/CPP/algorithm.h"],
566 deps = [
567 ":__support_macros_attributes",
568 ":__support_macros_config",
569 ],
570 )
571
572 libc_support_library(
573 name = "__support_cpp_iterator",
574 hdrs = ["src/__support/CPP/iterator.h"],
575 deps = [
576 ":__support_cpp_type_traits",
577 ":__support_macros_attributes",
578 ],
579 )
580
581 libc_support_library(
582 name = "__support_cpp_array",
583 hdrs = ["src/__support/CPP/array.h"],
584 deps = [
585 ":__support_cpp_iterator",
586 ":__support_macros_attributes",
587 ],
588 )
589
590 libc_support_library(
591 name = "__support_cpp_bit",
592 hdrs = ["src/__support/CPP/bit.h"],
593 deps = [
594 ":__support_cpp_limits",
595 ":__support_cpp_type_traits",
596 ":__support_macros_attributes",
597 ":__support_macros_sanitizer",
598 ],
599 )
600
601 libc_support_library(
602 name = "__support_cpp_bitset",
603 hdrs = ["src/__support/CPP/bitset.h"],
604 deps = [
605 ":__support_macros_attributes",
606 ":__support_macros_config",
607 ],
608 )
609
610 libc_support_library(
611 name = "__support_cpp_cstddef",
612 hdrs = ["src/__support/CPP/cstddef.h"],
613 deps = [
614 ":__support_cpp_type_traits",
615 ":__support_macros_attributes",
616 ],
617 )
618
619 libc_support_library(
620 name = "__support_cpp_expected",
621 hdrs = ["src/__support/CPP/expected.h"],
622 deps = [
623 ":__support_macros_attributes",
624 ":__support_macros_config",
625 ],
626 )
627
628 libc_support_library(
629 name = "__support_cpp_functional",
630 hdrs = ["src/__support/CPP/functional.h"],
631 deps = [
632 "__support_cpp_type_traits",
633 "__support_cpp_utility",
634 "__support_macros_attributes",
635 ],
636 )
637
638 libc_support_library(
639 name = "__support_cpp_limits",
640 hdrs = ["src/__support/CPP/limits.h"],
641 deps = [
642 "__support_cpp_type_traits",
643 "__support_macros_attributes",
644 ":__support_macros_properties_types",
645 ":hdr_limits_macros",
646 ],
647 )
648
649 libc_support_library(
650 name = "__support_cpp_new",
651 srcs = ["src/__support/CPP/new.cpp"],
652 hdrs = ["src/__support/CPP/new.h"],
653 deps = [
654 ":__support_common",
655 ":__support_macros_properties_os",
656 ":func_aligned_alloc",
657 ":func_free",
658 ":func_malloc",
659 ],
660 )
661
662 libc_support_library(
663 name = "__support_cpp_optional",
664 hdrs = ["src/__support/CPP/optional.h"],
665 deps = [
666 ":__support_cpp_utility",
667 ],
668 )
669
670 libc_support_library(
671 name = "__support_cpp_span",
672 hdrs = ["src/__support/CPP/span.h"],
673 deps = [
674 ":__support_cpp_array",
675 ":__support_cpp_limits",
676 ":__support_cpp_type_traits",
677 ],
678 )
679
680 libc_support_library(
681 name = "__support_cpp_string_view",
682 hdrs = ["src/__support/CPP/string_view.h"],
683 deps = [
684 ":__support_common",
685 ":__support_cpp_limits",
686 ],
687 )
688
689 libc_support_library(
690 name = "__support_cpp_stringstream",
691 hdrs = ["src/__support/CPP/stringstream.h"],
692 deps = [
693 ":__support_cpp_span",
694 ":__support_cpp_string_view",
695 ":__support_cpp_type_traits",
696 ":__support_integer_to_string",
697 ],
698 )
699
700 libc_support_library(
701 name = "__support_cpp_string",
702 hdrs = ["src/__support/CPP/string.h"],
703 deps = [
704 ":__support_common",
705 ":__support_cpp_string_view",
706 ":__support_integer_to_string",
707 ":func_free",
708 ":func_malloc",
709 ":func_realloc",
710 ":string_memory_utils",
711 ":string_utils",
712 ],
713 )
714
715 libc_support_library(
716 name = "__support_cpp_type_traits",
717 hdrs = glob(["src/__support/CPP/type_traits/*.h"]) + [
718 "src/__support/CPP/type_traits.h",
719 "src/__support/CPP/utility/declval.h",
720 "src/__support/CPP/utility/forward.h",
721 ],
722 deps = [
723 ":__support_macros_attributes",
724 ":__support_macros_config",
725 ":__support_macros_properties_complex_types",
726 ":__support_macros_properties_types",
727 ":llvm_libc_macros_stdfix_macros",
728 ],
729 )
730
731 libc_support_library(
732 name = "__support_cpp_utility",
733 hdrs = glob(["src/__support/CPP/utility/*.h"]) + [
734 "src/__support/CPP/utility.h",
735 ],
736 deps = [
737 ":__support_cpp_type_traits",
738 ":__support_macros_attributes",
739 ],
740 )
741
742 libc_support_library(
743 name = "__support_cpp_atomic",
744 hdrs = ["src/__support/CPP/atomic.h"],
745 deps = [
746 ":__support_cpp_type_traits",
747 ":__support_macros_attributes",
748 ":__support_macros_properties_architectures",
749 ],
750 )
751
752 libc_support_library(
753 name = "__support_blockstore",
754 hdrs = ["src/__support/blockstore.h"],
755 deps = [
756 ":__support_cpp_array",
757 ":__support_cpp_new",
758 ":__support_libc_assert",
759 ],
760 )
761
762 libc_support_library(
763 name = "__support_arg_list",
764 hdrs = ["src/__support/arg_list.h"],
765 deps = [
766 ":__support_common",
767 ],
768 )
769
770 libc_support_library(
771 name = "__support_c_string",
772 hdrs = ["src/__support/c_string.h"],
773 deps = [
774 ":__support_cpp_string",
775 ],
776 )
777
778 libc_support_library(
779 name = "__support_fixedvector",
780 hdrs = ["src/__support/fixedvector.h"],
781 deps = [
782 ":__support_cpp_array",
783 ":__support_cpp_iterator",
784 ":__support_libc_assert",
785 ":string_memory_utils",
786 ],
787 )
788
789 libc_support_library(
790 name = "__support_char_vector",
791 hdrs = ["src/__support/char_vector.h"],
792 deps = [
793 ":__support_common",
794 ":func_free",
795 ":func_malloc",
796 ":func_realloc",
797 ],
798 )
799
800 libc_support_library(
801 name = "__support_error_or",
802 hdrs = ["src/__support/error_or.h"],
803 deps = [
804 ":__support_common",
805 ":__support_cpp_expected",
806 ],
807 )
808
809 libc_support_library(
810 name = "__support_float_to_string",
811 hdrs = [
812 "src/__support/float_to_string.h",
813 "src/__support/ryu_constants.h",
814 "src/__support/ryu_long_double_constants.h",
815 ],
816 deps = [
817 ":__support_big_int",
818 ":__support_common",
819 ":__support_cpp_type_traits",
820 ":__support_fputil_dyadic_float",
821 ":__support_fputil_fp_bits",
822 ":__support_libc_assert",
823 ],
824 )
825
826 libc_support_library(
827 name = "__support_number_pair",
828 hdrs = ["src/__support/number_pair.h"],
829 deps = [
830 ":__support_cpp_type_traits",
831 ],
832 )
833
834 libc_support_library(
835 name = "__support_big_int",
836 hdrs = ["src/__support/big_int.h"],
837 deps = [
838 ":__support_cpp_array",
839 ":__support_cpp_bit",
840 ":__support_cpp_limits",
841 ":__support_cpp_optional",
842 ":__support_cpp_type_traits",
843 ":__support_macros_attributes",
844 ":__support_macros_optimization",
845 ":__support_macros_properties_types",
846 ":__support_math_extras",
847 ":__support_number_pair",
848 ],
849 )
850
851 libc_support_library(
852 name = "__support_sign",
853 hdrs = ["src/__support/sign.h"],
854 deps = [
855 ":__support_macros_attributes",
856 ],
857 )
858
859 libc_support_library(
860 name = "__support_uint128",
861 hdrs = ["src/__support/uint128.h"],
862 deps = [
863 ":__support_big_int",
864 ":__support_macros_attributes",
865 ":__support_macros_properties_types",
866 ],
867 )
868
869 libc_support_library(
870 name = "__support_integer_literals",
871 hdrs = ["src/__support/integer_literals.h"],
872 deps = [
873 ":__support_cpp_limits",
874 ":__support_ctype_utils",
875 ":__support_uint128",
876 ],
877 )
878
879 libc_support_library(
880 name = "__support_str_to_num_result",
881 hdrs = ["src/__support/str_to_num_result.h"],
882 deps = [
883 ":__support_macros_attributes",
884 ":__support_macros_config",
885 ],
886 )
887
888 libc_support_library(
889 name = "__support_integer_operations",
890 hdrs = ["src/__support/integer_operations.h"],
891 deps = [":__support_cpp_type_traits"],
892 )
893
894 libc_support_library(
895 name = "__support_integer_to_string",
896 hdrs = ["src/__support/integer_to_string.h"],
897 deps = [
898 ":__support_big_int",
899 ":__support_common",
900 ":__support_cpp_algorithm",
901 ":__support_cpp_bit",
902 ":__support_cpp_limits",
903 ":__support_cpp_optional",
904 ":__support_cpp_span",
905 ":__support_cpp_string_view",
906 ":__support_cpp_type_traits",
907 ":__support_ctype_utils",
908 ],
909 )
910
911 libc_support_library(
912 name = "__support_libc_assert",
913 hdrs = ["src/__support/libc_assert.h"],
914 )
915
916 libc_support_library(
917 name = "__support_ctype_utils",
918 hdrs = ["src/__support/ctype_utils.h"],
919 deps = [
920 ":__support_macros_attributes",
921 ":__support_macros_config",
922 ],
923 )
924
925 libc_support_library(
926 name = "__support_str_to_integer",
927 hdrs = ["src/__support/str_to_integer.h"],
928 deps = [
929 ":__support_common",
930 ":__support_cpp_limits",
931 ":__support_cpp_type_traits",
932 ":__support_ctype_utils",
933 ":__support_str_to_num_result",
934 ":__support_uint128",
935 ":hdr_errno_macros",
936 ],
937 )
938
939 libc_support_library(
940 name = "__support_str_to_float",
941 hdrs = [
942 "src/__support/detailed_powers_of_ten.h",
943 "src/__support/high_precision_decimal.h",
944 "src/__support/str_to_float.h",
945 ],
946 deps = [
947 ":__support_common",
948 ":__support_cpp_bit",
949 ":__support_cpp_limits",
950 ":__support_cpp_optional",
951 ":__support_cpp_string_view",
952 ":__support_ctype_utils",
953 ":__support_fputil_fp_bits",
954 ":__support_fputil_rounding_mode",
955 ":__support_macros_null_check",
956 ":__support_str_to_integer",
957 ":__support_str_to_num_result",
958 ":__support_uint128",
959 ":hdr_errno_macros",
960 ],
961 )
962
963 libc_support_library(
964 name = "__support_complex_type",
965 hdrs = ["src/__support/complex_type.h"],
966 deps = [
967 ":__support_macros_config",
968 ":__support_macros_properties_complex_types",
969 ":__support_macros_properties_types",
970 ],
971 )
972
973 libc_support_library(
974 name = "__support_complex_basic_ops",
975 hdrs = ["src/__support/complex_basic_ops.h"],
976 deps = [
977 ":__support_complex_type",
978 ":__support_cpp_bit",
979 ":__support_fputil_fp_bits",
980 ],
981 )
982
983 libc_support_library(
984 name = "__support_fputil_basic_operations",
985 hdrs = [
986 "src/__support/FPUtil/BasicOperations.h",
987 "src/__support/FPUtil/generic/add_sub.h",
988 "src/__support/FPUtil/generic/div.h",
989 "src/__support/FPUtil/generic/mul.h",
990 ],
991 deps = [
992 ":__support_common",
993 ":__support_cpp_type_traits",
994 ":__support_fputil_cast",
995 ":__support_fputil_dyadic_float",
996 ":__support_fputil_fenv_impl",
997 ":__support_fputil_fp_bits",
998 ":__support_fputil_rounding_mode",
999 ":__support_macros_optimization",
1000 ":__support_uint128",
1001 ],
1002 )
1003
1004 libc_support_library(
1005 name = "__support_file_file",
1006 srcs = [
1007 "include/llvm-libc-types/off_t.h",
1008 "src/__support/File/file.cpp",
1009 ],
1010 hdrs = ["src/__support/File/file.h"],
1011 deps = [
1012 ":__support_cpp_new",
1013 ":__support_cpp_span",
1014 ":__support_error_or",
1015 ":__support_threads_mutex",
1016 ":errno",
1017 ":func_aligned_alloc",
1018 ":func_free",
1019 ":func_malloc",
1020 ":func_realloc",
1021 ":hdr_stdio_macros",
1022 ":hdr_stdio_overlay",
1023 ":types_off_t",
1024 ],
1025 )
1026
1027 libc_support_library(
1028 name = "__support_file_linux_lseekimpl",
1029 hdrs = ["src/__support/File/linux/lseekImpl.h"],
1030 deps = [
1031 ":__support_common",
1032 ":__support_error_or",
1033 ":__support_osutil_syscall",
1034 ":errno",
1035 ":hdr_stdio_overlay",
1036 ":types_off_t",
1037 ],
1038 )
1039
1040 libc_support_library(
1041 name = "__support_math_extras",
1042 hdrs = ["src/__support/math_extras.h"],
1043 deps = [
1044 ":__support_cpp_bit",
1045 ":__support_cpp_limits",
1046 ":__support_cpp_type_traits",
1047 ":__support_macros_attributes",
1048 ],
1049 )
1050
1051 libc_support_library(
1052 name = "__support_fixed_point",
1053 hdrs = [
1054 "src/__support/fixed_point/fx_bits.h",
1055 "src/__support/fixed_point/fx_rep.h",
1056 ],
1057 deps = [
1058 ":__support_cpp_bit",
1059 ":__support_cpp_type_traits",
1060 ":__support_macros_attributes",
1061 ":__support_macros_null_check",
1062 ":__support_macros_optimization",
1063 ":__support_math_extras",
1064 ":llvm_libc_macros_stdfix_macros",
1065 ],
1066 )
1067
1068 libc_support_library(
1069 name = "__support_fputil_generic_fmod",
1070 hdrs = ["src/__support/FPUtil/generic/FMod.h"],
1071 deps = [
1072 ":__support_common",
1073 ":__support_cpp_bit",
1074 ":__support_cpp_limits",
1075 ":__support_cpp_type_traits",
1076 ":__support_fputil_fenv_impl",
1077 ":__support_fputil_fp_bits",
1078 ],
1079 )
1080
1081 libc_support_library(
1082 name = "__support_fputil_bfloat16",
1083 hdrs = ["src/__support/FPUtil/bfloat16.h"],
1084 deps = [
1085 ":__support_cpp_bit",
1086 ":__support_cpp_type_traits",
1087 ":__support_fputil_cast",
1088 ":__support_fputil_dyadic_float",
1089 ":__support_macros_config",
1090 ":__support_macros_properties_types",
1091 ],
1092 )
1093
1094 alias(
1095 name = "bfloat16", # Alias for test/src/math:bfloat16_test.
1096 actual = ":__support_fputil_bfloat16",
1097 )
1098
1099 libc_support_library(
1100 name = "__support_fputil_cast",
1101 hdrs = ["src/__support/FPUtil/cast.h"],
1102 deps = [
1103 ":__support_cpp_algorithm",
1104 ":__support_cpp_type_traits",
1105 ":__support_fputil_dyadic_float",
1106 ":__support_fputil_fp_bits",
1107 ":__support_macros_properties_types",
1108 ":hdr_fenv_macros",
1109 ],
1110 )
1111
1112 libc_support_library(
1113 name = "__support_fputil_division_and_remainder_operations",
1114 hdrs = ["src/__support/FPUtil/DivisionAndRemainderOperations.h"],
1115 deps = [
1116 ":__support_common",
1117 ":__support_cpp_type_traits",
1118 ":__support_fputil_fp_bits",
1119 ":__support_fputil_manipulation_functions",
1120 ":__support_fputil_normal_float",
1121 ],
1122 )
1123
1124 libc_support_library(
1125 name = "__support_fputil_except_value_utils",
1126 hdrs = ["src/__support/FPUtil/except_value_utils.h"],
1127 deps = [
1128 ":__support_cpp_optional",
1129 ":__support_fputil_cast",
1130 ":__support_fputil_fenv_impl",
1131 ":__support_fputil_fp_bits",
1132 ":__support_fputil_rounding_mode",
1133 ":__support_macros_properties_cpu_features",
1134 ":__support_macros_properties_types",
1135 ],
1136 )
1137
1138 libc_support_library(
1139 name = "__support_fputil_fenv_impl",
1140 hdrs = ["src/__support/FPUtil/FEnvImpl.h"],
1141 textual_hdrs = [
1142 "src/__support/FPUtil/x86_64/FEnvImpl.h",
1143 "src/__support/FPUtil/aarch64/FEnvImpl.h",
1144 "src/__support/FPUtil/aarch64/fenv_darwin_impl.h",
1145 ],
1146 deps = [
1147 ":__support_fputil_fp_bits",
1148 ":__support_macros_attributes",
1149 ":__support_macros_properties_architectures",
1150 ":__support_macros_sanitizer",
1151 ":errno",
1152 ":hdr_fenv_macros",
1153 ":hdr_math_macros",
1154 ":types_fenv_t",
1155 ],
1156 )
1157
1158 libc_support_library(
1159 name = "__support_fputil_rounding_mode",
1160 hdrs = ["src/__support/FPUtil/rounding_mode.h"],
1161 deps = [
1162 ":__support_macros_attributes",
1163 ":__support_macros_config",
1164 ":hdr_fenv_macros",
1165 ],
1166 )
1167
1168 libc_support_library(
1169 name = "__support_fputil_fp_bits",
1170 hdrs = ["src/__support/FPUtil/FPBits.h"],
1171 deps = [
1172 ":__support_common",
1173 ":__support_cpp_bit",
1174 ":__support_cpp_type_traits",
1175 ":__support_libc_assert",
1176 ":__support_macros_attributes",
1177 ":__support_macros_properties_types",
1178 ":__support_math_extras",
1179 ":__support_sign",
1180 ":__support_uint128",
1181 ],
1182 )
1183
1184 libc_support_library(
1185 name = "__support_fputil_fpbits_str",
1186 hdrs = ["src/__support/FPUtil/fpbits_str.h"],
1187 deps = [
1188 ":__support_common",
1189 ":__support_cpp_string",
1190 ":__support_cpp_type_traits",
1191 ":__support_fputil_fp_bits",
1192 ":__support_integer_to_string",
1193 ":__support_uint128",
1194 ],
1195 )
1196
1197 libc_support_library(
1198 name = "__support_fputil_hypot",
1199 hdrs = ["src/__support/FPUtil/Hypot.h"],
1200 deps = [
1201 ":__support_common",
1202 ":__support_cpp_bit",
1203 ":__support_cpp_type_traits",
1204 ":__support_fputil_basic_operations",
1205 ":__support_fputil_fenv_impl",
1206 ":__support_fputil_fp_bits",
1207 ":__support_fputil_rounding_mode",
1208 ":__support_uint128",
1209 ],
1210 )
1211
1212 libc_support_library(
1213 name = "__support_fputil_manipulation_functions",
1214 hdrs = ["src/__support/FPUtil/ManipulationFunctions.h"],
1215 textual_hdrs = [
1216 "src/__support/FPUtil/x86_64/NextAfterLongDouble.h",
1217 "src/__support/FPUtil/x86_64/NextUpDownLongDouble.h",
1218 ],
1219 deps = [
1220 ":__support_common",
1221 ":__support_cpp_bit",
1222 ":__support_cpp_limits",
1223 ":__support_cpp_type_traits",
1224 ":__support_fputil_cast",
1225 ":__support_fputil_dyadic_float",
1226 ":__support_fputil_fp_bits",
1227 ":__support_fputil_nearest_integer_operations",
1228 ":__support_fputil_normal_float",
1229 ":__support_macros_optimization",
1230 ":__support_uint128",
1231 ":hdr_math_macros",
1232 ],
1233 )
1234
1235 libc_support_library(
1236 name = "__support_fputil_nearest_integer_operations",
1237 hdrs = ["src/__support/FPUtil/NearestIntegerOperations.h"],
1238 deps = [
1239 ":__support_common",
1240 ":__support_cpp_type_traits",
1241 ":__support_fputil_fenv_impl",
1242 ":__support_fputil_fp_bits",
1243 ":__support_fputil_rounding_mode",
1244 ":__support_macros_attributes",
1245 ":hdr_math_macros",
1246 ],
1247 )
1248
1249 libc_support_library(
1250 name = "__support_fputil_normal_float",
1251 hdrs = ["src/__support/FPUtil/NormalFloat.h"],
1252 deps = [
1253 ":__support_common",
1254 ":__support_cpp_type_traits",
1255 ":__support_fputil_fp_bits",
1256 ],
1257 )
1258
1259 sqrt_common_hdrs = [
1260 "src/__support/FPUtil/sqrt.h",
1261 "src/__support/FPUtil/generic/sqrt.h",
1262 "src/__support/FPUtil/generic/sqrt_80_bit_long_double.h",
1263 ]
1264
1265 sqrt_hdrs = selects.with_or({
1266 "//conditions:default": sqrt_common_hdrs,
1267 PLATFORM_CPU_X86_64: sqrt_common_hdrs + [
1268 "src/__support/FPUtil/x86_64/sqrt.h",
1269 ],
1270 PLATFORM_CPU_ARM64: sqrt_common_hdrs + [
1271 "src/__support/FPUtil/aarch64/sqrt.h",
1272 ],
1273 })
1274
1275 libc_support_library(
1276 name = "__support_fputil_sqrt",
1277 hdrs = sqrt_hdrs,
1278 deps = [
1279 ":__support_common",
1280 ":__support_cpp_bit",
1281 ":__support_cpp_type_traits",
1282 ":__support_fputil_cast",
1283 ":__support_fputil_dyadic_float",
1284 ":__support_fputil_fenv_impl",
1285 ":__support_fputil_fp_bits",
1286 ":__support_fputil_rounding_mode",
1287 ":__support_macros_properties_cpu_features",
1288 ":__support_uint128",
1289 ],
1290 )
1291
1292 fma_common_hdrs = [
1293 "src/__support/FPUtil/FMA.h",
1294 "src/__support/FPUtil/generic/FMA.h",
1295 ]
1296
1297 libc_support_library(
1298 name = "__support_fputil_fma",
1299 hdrs = fma_common_hdrs,
1300 deps = [
1301 ":__support_cpp_bit",
1302 ":__support_cpp_type_traits",
1303 ":__support_fputil_basic_operations",
1304 ":__support_fputil_dyadic_float",
1305 ":__support_fputil_fenv_impl",
1306 ":__support_fputil_fp_bits",
1307 ":__support_fputil_rounding_mode",
1308 ":__support_macros_attributes",
1309 ":__support_macros_optimization",
1310 ":__support_macros_properties_cpu_features",
1311 ":__support_uint128",
1312 ],
1313 )
1314
1315 libc_support_library(
1316 name = "__support_fputil_multiply_add",
1317 hdrs = [
1318 "src/__support/FPUtil/multiply_add.h",
1319 ],
1320 deps = [
1321 ":__support_common",
1322 ":__support_cpp_type_traits",
1323 ],
1324 )
1325
1326 libc_support_library(
1327 name = "__support_fputil_polyeval",
1328 hdrs = [
1329 "src/__support/FPUtil/PolyEval.h",
1330 ],
1331 deps = [
1332 ":__support_common",
1333 ":__support_fputil_multiply_add",
1334 ],
1335 )
1336
1337 nearest_integer_common_hdrs = [
1338 "src/__support/FPUtil/nearest_integer.h",
1339 ]
1340
1341 nearest_integer_platform_hdrs = [
1342 "src/__support/FPUtil/x86_64/nearest_integer.h",
1343 "src/__support/FPUtil/aarch64/nearest_integer.h",
1344 ]
1345
1346 libc_support_library(
1347 name = "__support_fputil_nearest_integer",
1348 hdrs = nearest_integer_common_hdrs,
1349 # These are conditionally included and will #error out if the platform
1350 # doesn't support rounding instructions, so they can't be compiled on their
1351 # own.
1352 textual_hdrs = nearest_integer_platform_hdrs,
1353 deps = [
1354 ":__support_common",
1355 ":__support_macros_optimization",
1356 ":__support_macros_properties_architectures",
1357 ":__support_macros_properties_cpu_features",
1358 ],
1359 )
1360
1361 libc_support_library(
1362 name = "__support_fputil_double_double",
1363 hdrs = ["src/__support/FPUtil/double_double.h"],
1364 deps = [
1365 ":__support_common",
1366 ":__support_fputil_multiply_add",
1367 ":__support_number_pair",
1368 ],
1369 )
1370
1371 libc_support_library(
1372 name = "__support_fputil_triple_double",
1373 hdrs = ["src/__support/FPUtil/triple_double.h"],
1374 deps = [
1375 ":__support_common",
1376 ],
1377 )
1378
1379 libc_support_library(
1380 name = "__support_fputil_dyadic_float",
1381 hdrs = ["src/__support/FPUtil/dyadic_float.h"],
1382 deps = [
1383 ":__support_big_int",
1384 ":__support_common",
1385 ":__support_cpp_type_traits",
1386 ":__support_fputil_fenv_impl",
1387 ":__support_fputil_fp_bits",
1388 ":__support_fputil_multiply_add",
1389 ":__support_fputil_rounding_mode",
1390 ":__support_macros_optimization",
1391 ],
1392 )
1393
1394 libc_support_library(
1395 name = "__support_osutil_syscall",
1396 hdrs = ["src/__support/OSUtil/syscall.h"],
1397 textual_hdrs = select({
1398 "@platforms//os:macos": [
1399 "src/__support/OSUtil/darwin/syscall.h",
1400 "src/__support/OSUtil/darwin/arm/syscall.h",
1401 ],
1402 "@platforms//os:linux": [
1403 "src/__support/OSUtil/linux/syscall.h",
1404 "src/__support/OSUtil/linux/aarch64/syscall.h",
1405 "src/__support/OSUtil/linux/x86_64/syscall.h",
1406 ],
1407 "@platforms//os:windows": [],
1408 }),
1409 deps = [
1410 ":__support_common",
1411 ":__support_cpp_bit",
1412 ":__support_macros_sanitizer",
1413 ],
1414 )
1415
1416 libc_support_library(
1417 name = "__support_osutil_vdso",
1418 hdrs = [
1419 "src/__support/OSUtil/linux/vdso.h",
1420 "src/__support/OSUtil/linux/vdso_sym.h",
1421 ],
1422 target_compatible_with = select({
1423 "@platforms//os:linux": [],
1424 "//conditions:default": ["@platforms//:incompatible"],
1425 }),
1426 textual_hdrs = [
1427 "src/__support/OSUtil/linux/riscv/vdso.h",
1428 "src/__support/OSUtil/linux/arm/vdso.h",
1429 "src/__support/OSUtil/linux/x86_64/vdso.h",
1430 "src/__support/OSUtil/linux/aarch64/vdso.h",
1431 ],
1432 deps = [
1433 ":__support_cpp_array",
1434 ":__support_cpp_optional",
1435 ":__support_cpp_string_view",
1436 ":__support_threads_callonce",
1437 ":types_clock_t",
1438 ":types_clockid_t",
1439 ":types_struct_timeval",
1440 ],
1441 )
1442
1443 libc_support_library(
1444 name = "__support_osutil_io",
1445 hdrs = ["src/__support/OSUtil/io.h"],
1446 textual_hdrs = select({
1447 "@platforms//os:macos": ["src/__support/OSUtil/darwin/io.h"],
1448 "@platforms//os:linux": ["src/__support/OSUtil/linux/io.h"],
1449 "@platforms//os:windows": ["src/__support/OSUtil/windows/io.h"],
1450 }),
1451 deps = [
1452 ":__support_common",
1453 ":__support_cpp_string_view",
1454 ":__support_osutil_syscall",
1455 ":string_utils",
1456 ],
1457 )
1458
1459 libc_support_library(
1460 name = "__support_osutil_fcntl",
1461 srcs = ["src/__support/OSUtil/linux/fcntl.cpp"],
1462 hdrs = ["src/__support/OSUtil/fcntl.h"],
1463 target_compatible_with = select({
1464 "@platforms//os:linux": [],
1465 "//conditions:default": ["@platforms//:incompatible"],
1466 }),
1467 deps = [
1468 ":__support_common",
1469 ":__support_error_or",
1470 ":__support_osutil_syscall",
1471 ":hdr_errno_macros",
1472 ":hdr_fcntl_macros",
1473 ":types_mode_t",
1474 ":types_off_t",
1475 ":types_struct_f_owner_ex",
1476 ":types_struct_flock",
1477 ":types_struct_flock64",
1478 ],
1479 )
1480
1481 libc_support_library(
1482 name = "__support_osutil_exit",
1483 srcs = ["src/__support/OSUtil/linux/exit.cpp"],
1484 hdrs = ["src/__support/OSUtil/exit.h"],
1485 target_compatible_with = select({
1486 "@platforms//os:linux": [],
1487 "//conditions:default": ["@platforms//:incompatible"],
1488 }),
1489 deps = [
1490 ":__support_osutil_syscall",
1491 ],
1492 )
1493
1494 libc_support_library(
1495 name = "__support_stringutil",
1496 srcs = glob(["src/__support/StringUtil/tables/**/*.h"]) + [
1497 "src/__support/StringUtil/error_to_string.cpp",
1498 "src/__support/StringUtil/message_mapper.h",
1499 "src/__support/StringUtil/platform_errors.h",
1500 "src/__support/StringUtil/platform_signals.h",
1501 "src/__support/StringUtil/signal_to_string.cpp",
1502 ],
1503 hdrs = [
1504 "src/__support/StringUtil/error_to_string.h",
1505 "src/__support/StringUtil/signal_to_string.h",
1506 ],
1507 target_compatible_with = select({
1508 "@platforms//os:linux": [],
1509 "//conditions:default": ["@platforms//:incompatible"],
1510 }),
1511 deps = [
1512 ":__support_cpp_array",
1513 ":__support_cpp_span",
1514 ":__support_cpp_string_view",
1515 ":__support_cpp_stringstream",
1516 ":__support_integer_to_string",
1517 ":__support_macros_attributes",
1518 ":errno",
1519 ],
1520 )
1521
1522 libc_support_library(
1523 name = "__support_threads_linux_futex_word_type",
1524 hdrs = [
1525 "src/__support/threads/linux/futex_word.h",
1526 ],
1527 target_compatible_with = select({
1528 "@platforms//os:linux": [],
1529 "//conditions:default": ["@platforms//:incompatible"],
1530 }),
1531 deps = [
1532 ":__support_osutil_syscall",
1533 ],
1534 )
1535
1536 libc_support_library(
1537 name = "__support_threads_linux_futex_utils",
1538 hdrs = [
1539 "src/__support/threads/linux/futex_utils.h",
1540 ],
1541 target_compatible_with = select({
1542 "@platforms//os:linux": [],
1543 "//conditions:default": ["@platforms//:incompatible"],
1544 }),
1545 deps = [
1546 ":__support_cpp_atomic",
1547 ":__support_cpp_optional",
1548 ":__support_osutil_syscall",
1549 ":__support_threads_linux_futex_word_type",
1550 ":__support_time_linux_abs_timeout",
1551 ":types_struct_timespec",
1552 ],
1553 )
1554
1555 libc_support_library(
1556 name = "__support_threads_sleep",
1557 hdrs = ["src/__support/threads/sleep.h"],
1558 deps = [
1559 ":__support_macros_attributes",
1560 ":__support_macros_config",
1561 ],
1562 )
1563
1564 libc_support_library(
1565 name = "__support_threads_raw_mutex",
1566 hdrs = [
1567 "src/__support/threads/linux/raw_mutex.h",
1568 ],
1569 target_compatible_with = select({
1570 "@platforms//os:linux": [],
1571 "//conditions:default": ["@platforms//:incompatible"],
1572 }),
1573 deps = [
1574 ":__support_cpp_expected",
1575 ":__support_cpp_optional",
1576 ":__support_threads_linux_futex_utils",
1577 ":__support_threads_sleep",
1578 ":__support_time_linux_abs_timeout",
1579 ":__support_time_linux_monotonicity",
1580 ":types_pid_t",
1581 ],
1582 )
1583
1584 libc_support_library(
1585 name = "__support_threads_mutex",
1586 hdrs = [
1587 "src/__support/threads/mutex.h",
1588 "src/__support/threads/mutex_common.h",
1589 ],
1590 target_compatible_with = select({
1591 "@platforms//os:linux": [],
1592 "//conditions:default": ["@platforms//:incompatible"],
1593 }),
1594 textual_hdrs = [
1595 "src/__support/threads/linux/mutex.h",
1596 ],
1597 deps = [
1598 ":__support_cpp_atomic",
1599 ":__support_osutil_syscall",
1600 ":__support_threads_linux_futex_utils",
1601 ":__support_threads_raw_mutex",
1602 ":types_pid_t",
1603 ],
1604 )
1605
1606 libc_support_library(
1607 name = "__support_threads_callonce",
1608 hdrs = [
1609 "src/__support/threads/callonce.h",
1610 ],
1611 target_compatible_with = select({
1612 "@platforms//os:linux": [],
1613 "//conditions:default": ["@platforms//:incompatible"],
1614 }),
1615 textual_hdrs = [
1616 "src/__support/threads/linux/callonce.h",
1617 ],
1618 deps = [
1619 ":__support_macros_config",
1620 ":__support_macros_optimization",
1621 ":__support_threads_linux_futex_utils",
1622 ],
1623 )
1624
1625 libc_support_library(
1626 name = "__support_time",
1627 hdrs = glob(["src/__support/time/*.h"]),
1628 deps = [
1629 ":__support_common",
1630 ":__support_error_or",
1631 ":hdr_time_macros",
1632 ":types_clockid_t",
1633 ":types_struct_timespec",
1634 ":types_time_t",
1635 ],
1636 )
1637
1638 libc_support_library(
1639 name = "__support_time_linux_abs_timeout",
1640 hdrs = ["src/__support/time/linux/abs_timeout.h"],
1641 target_compatible_with = select({
1642 "@platforms//os:linux": [],
1643 "//conditions:default": ["@platforms//:incompatible"],
1644 }),
1645 deps = [
1646 ":__support_cpp_expected",
1647 ":__support_time",
1648 ":hdr_time_macros",
1649 ":types_struct_timespec",
1650 ],
1651 )
1652
1653 libc_support_library(
1654 name = "__support_time_linux_clock_conversion",
1655 hdrs = ["src/__support/time/linux/clock_conversion.h"],
1656 target_compatible_with = select({
1657 "@platforms//os:linux": [],
1658 "//conditions:default": ["@platforms//:incompatible"],
1659 }),
1660 deps = [
1661 ":__support_time",
1662 ":__support_time_clock_gettime",
1663 ],
1664 )
1665
1666 libc_support_library(
1667 name = "__support_time_clock_gettime",
1668 hdrs = ["src/__support/time/clock_gettime.h"],
1669 target_compatible_with = select({
1670 "@platforms//os:linux": [],
1671 "//conditions:default": ["@platforms//:incompatible"],
1672 }),
1673 deps = [
1674 ":__support_common",
1675 ":__support_error_or",
1676 ":__support_osutil_vdso",
1677 ":types_clockid_t",
1678 ":types_struct_timespec",
1679 ],
1680 )
1681
1682 libc_support_library(
1683 name = "__support_time_linux_monotonicity",
1684 hdrs = ["src/__support/time/linux/monotonicity.h"],
1685 target_compatible_with = select({
1686 "@platforms//os:linux": [],
1687 "//conditions:default": ["@platforms//:incompatible"],
1688 }),
1689 deps = [
1690 ":__support_libc_assert",
1691 ":__support_time_linux_abs_timeout",
1692 ":__support_time_linux_clock_conversion",
1693 ":hdr_time_macros",
1694 ],
1695 )
1696
1697 libc_support_library(
1698 name = "__support_wctype_utils",
1699 hdrs = ["src/__support/wctype_utils.h"],
1700 deps = [
1701 ":__support_cpp_optional",
1702 ":__support_macros_attributes",
1703 ":__support_macros_config",
1704 ":types_wint_t",
1705 ],
1706 )
1707
1708 ########################## externally shared targets ###########################
1709
1710 libc_header_library(
1711 name = "libcxx_shared_headers",
1712 hdrs = [
1713 "shared/fp_bits.h",
1714 "shared/libc_common.h",
1715 "shared/str_to_float.h",
1716 "shared/str_to_integer.h",
1717 ],
1718 deps = [
1719 ":__support_common",
1720 ":__support_fputil_fp_bits",
1721 ":__support_str_to_float",
1722 ":__support_str_to_integer",
1723 ],
1724 )
1725
1726 ############################### errno ########################################
1727
1728 libc_support_library(
1729 name = "__support_libc_errno",
1730 hdrs = ["src/__support/libc_errno.h"],
1731 deps = [
1732 ":__support_macros_config",
1733 ":hdr_errno_macros",
1734 ],
1735 )
1736
1737 libc_support_library(
1738 name = "errno",
1739 srcs = ["src/errno/libc_errno.cpp"],
1740 deps = [
1741 ":__support_common",
1742 ":__support_cpp_atomic",
1743 ":__support_libc_errno",
1744 ":__support_macros_attributes",
1745 ":__support_macros_properties_architectures",
1746 ":hdr_errno_macros",
1747 ],
1748 )
1749
1750 ################################ fenv targets ################################
1751
1752 libc_function(
1753 name = "fetestexcept",
1754 srcs = ["src/fenv/fetestexcept.cpp"],
1755 hdrs = ["src/fenv/fetestexcept.h"],
1756 deps = [
1757 ":__support_common",
1758 ":__support_fputil_fenv_impl",
1759 ],
1760 )
1761
1762 libc_function(
1763 name = "fetestexceptflag",
1764 srcs = ["src/fenv/fetestexceptflag.cpp"],
1765 hdrs = ["src/fenv/fetestexceptflag.h"],
1766 deps = [
1767 ":__support_common",
1768 ":__support_fputil_fenv_impl",
1769 ":types_fexcept_t",
1770 ],
1771 )
1772
1773 libc_function(
1774 name = "feclearexcept",
1775 srcs = ["src/fenv/feclearexcept.cpp"],
1776 hdrs = ["src/fenv/feclearexcept.h"],
1777 deps = [
1778 ":__support_common",
1779 ":__support_fputil_fenv_impl",
1780 ],
1781 )
1782
1783 libc_function(
1784 name = "feraiseexcept",
1785 srcs = ["src/fenv/feraiseexcept.cpp"],
1786 hdrs = ["src/fenv/feraiseexcept.h"],
1787 deps = [
1788 ":__support_common",
1789 ":__support_fputil_fenv_impl",
1790 ],
1791 )
1792
1793 libc_function(
1794 name = "fegetround",
1795 srcs = ["src/fenv/fegetround.cpp"],
1796 hdrs = ["src/fenv/fegetround.h"],
1797 deps = [
1798 ":__support_common",
1799 ":__support_fputil_fenv_impl",
1800 ],
1801 )
1802
1803 libc_function(
1804 name = "fesetround",
1805 srcs = ["src/fenv/fesetround.cpp"],
1806 hdrs = ["src/fenv/fesetround.h"],
1807 deps = [
1808 ":__support_common",
1809 ":__support_fputil_fenv_impl",
1810 ],
1811 )
1812
1813 libc_function(
1814 name = "fedisableexcept",
1815 srcs = ["src/fenv/fedisableexcept.cpp"],
1816 hdrs = ["src/fenv/fedisableexcept.h"],
1817 deps = [
1818 ":__support_common",
1819 ":__support_fputil_fenv_impl",
1820 ],
1821 )
1822
1823 libc_function(
1824 name = "feenableexcept",
1825 srcs = ["src/fenv/feenableexcept.cpp"],
1826 hdrs = ["src/fenv/feenableexcept.h"],
1827 deps = [
1828 ":__support_common",
1829 ":__support_fputil_fenv_impl",
1830 ],
1831 )
1832
1833 libc_function(
1834 name = "fegetexcept",
1835 srcs = ["src/fenv/fegetexcept.cpp"],
1836 hdrs = ["src/fenv/fegetexcept.h"],
1837 deps = [
1838 ":__support_common",
1839 ":__support_fputil_fenv_impl",
1840 ],
1841 )
1842
1843 libc_function(
1844 name = "fegetenv",
1845 srcs = ["src/fenv/fegetenv.cpp"],
1846 hdrs = ["src/fenv/fegetenv.h"],
1847 deps = [
1848 ":__support_common",
1849 ":__support_fputil_fenv_impl",
1850 ],
1851 )
1852
1853 libc_function(
1854 name = "fesetenv",
1855 srcs = ["src/fenv/fesetenv.cpp"],
1856 hdrs = ["src/fenv/fesetenv.h"],
1857 deps = [
1858 ":__support_common",
1859 ":__support_fputil_fenv_impl",
1860 ],
1861 )
1862
1863 libc_function(
1864 name = "feupdateenv",
1865 srcs = ["src/fenv/feupdateenv.cpp"],
1866 hdrs = ["src/fenv/feupdateenv.h"],
1867 deps = [
1868 ":__support_common",
1869 ":__support_fputil_fenv_impl",
1870 ],
1871 )
1872
1873 libc_function(
1874 name = "fesetexcept",
1875 srcs = ["src/fenv/fesetexcept.cpp"],
1876 hdrs = ["src/fenv/fesetexcept.h"],
1877 deps = [
1878 ":__support_common",
1879 ":__support_fputil_fenv_impl",
1880 ],
1881 )
1882
1883 libc_function(
1884 name = "fegetexceptflag",
1885 srcs = ["src/fenv/fegetexceptflag.cpp"],
1886 hdrs = ["src/fenv/fegetexceptflag.h"],
1887 deps = [
1888 ":__support_common",
1889 ":__support_fputil_fenv_impl",
1890 ":types_fexcept_t",
1891 ],
1892 )
1893
1894 libc_function(
1895 name = "fesetexceptflag",
1896 srcs = ["src/fenv/fesetexceptflag.cpp"],
1897 hdrs = ["src/fenv/fesetexceptflag.h"],
1898 deps = [
1899 ":__support_common",
1900 ":__support_fputil_fenv_impl",
1901 ":types_fexcept_t",
1902 ],
1903 )
1904
1905 libc_function(
1906 name = "feholdexcept",
1907 srcs = ["src/fenv/feholdexcept.cpp"],
1908 hdrs = ["src/fenv/feholdexcept.h"],
1909 deps = [
1910 ":__support_common",
1911 ":__support_fputil_fenv_impl",
1912 ],
1913 )
1914
1915 ########################### math support library ###############################
1916
1917 libc_support_library(
1918 name = "common_constants",
1919 srcs = ["src/math/generic/common_constants.cpp"],
1920 hdrs = ["src/math/generic/common_constants.h"],
1921 deps = [
1922 ":__support_fputil_triple_double",
1923 ":__support_number_pair",
1924 ],
1925 )
1926
1927 libc_support_library(
1928 name = "range_reduction",
1929 hdrs = [
1930 "src/math/generic/range_reduction.h",
1931 "src/math/generic/range_reduction_fma.h",
1932 ],
1933 deps = [
1934 ":__support_common",
1935 ":__support_fputil_fma",
1936 ":__support_fputil_fp_bits",
1937 ":__support_fputil_multiply_add",
1938 ":__support_fputil_nearest_integer",
1939 ],
1940 )
1941
1942 libc_support_library(
1943 name = "range_reduction_double",
1944 hdrs = [
1945 "src/math/generic/range_reduction_double_common.h",
1946 "src/math/generic/range_reduction_double_fma.h",
1947 "src/math/generic/range_reduction_double_nofma.h",
1948 ],
1949 deps = [
1950 ":__support_common",
1951 ":__support_fputil_double_double",
1952 ":__support_fputil_dyadic_float",
1953 ":__support_fputil_fp_bits",
1954 ":__support_fputil_multiply_add",
1955 ":__support_fputil_nearest_integer",
1956 ":__support_fputil_rounding_mode",
1957 ":__support_integer_literals",
1958 ],
1959 )
1960
1961 libc_support_library(
1962 name = "sincos_eval",
1963 hdrs = [
1964 "src/math/generic/sincos_eval.h",
1965 ],
1966 deps = [
1967 ":__support_common",
1968 ":__support_fputil_double_double",
1969 ":__support_fputil_dyadic_float",
1970 ":__support_fputil_fp_bits",
1971 ":__support_fputil_multiply_add",
1972 ":__support_fputil_polyeval",
1973 ":__support_integer_literals",
1974 ],
1975 )
1976
1977 libc_support_library(
1978 name = "sincosf_utils",
1979 hdrs = ["src/math/generic/sincosf_utils.h"],
1980 deps = [
1981 ":__support_fputil_fp_bits",
1982 ":__support_fputil_polyeval",
1983 ":range_reduction",
1984 ],
1985 )
1986
1987 libc_support_library(
1988 name = "sincosf16_utils",
1989 hdrs = ["src/math/generic/sincosf16_utils.h"],
1990 deps = [
1991 ":__support_common",
1992 ":__support_fputil_nearest_integer",
1993 ":__support_fputil_polyeval",
1994 ],
1995 )
1996
1997 libc_support_library(
1998 name = "explogxf",
1999 srcs = ["src/math/generic/explogxf.cpp"],
2000 hdrs = ["src/math/generic/explogxf.h"],
2001 deps = [
2002 ":__support_common",
2003 ":__support_fputil_fenv_impl",
2004 ":__support_fputil_fma",
2005 ":__support_fputil_fp_bits",
2006 ":__support_fputil_multiply_add",
2007 ":__support_fputil_nearest_integer",
2008 ":__support_fputil_polyeval",
2009 ":common_constants",
2010 ],
2011 )
2012
2013 libc_support_library(
2014 name = "inv_trigf_utils",
2015 srcs = ["src/math/generic/inv_trigf_utils.cpp"],
2016 hdrs = [
2017 "src/math/generic/inv_trigf_utils.h",
2018 ],
2019 deps = [
2020 ":__support_common",
2021 ":__support_fputil_double_double",
2022 ":__support_fputil_fma",
2023 ":__support_fputil_multiply_add",
2024 ":__support_fputil_polyeval",
2025 ":__support_integer_literals",
2026 ],
2027 )
2028
2029 libc_support_library(
2030 name = "atan_utils",
2031 hdrs = ["src/math/generic/atan_utils.h"],
2032 deps = [
2033 ":__support_fputil_double_double",
2034 ":__support_fputil_dyadic_float",
2035 ":__support_fputil_multiply_add",
2036 ":__support_fputil_polyeval",
2037 ":__support_integer_literals",
2038 ":__support_macros_optimization",
2039 ],
2040 )
2041
2042 libc_support_library(
2043 name = "log_range_reduction",
2044 hdrs = ["src/math/generic/log_range_reduction.h"],
2045 deps = [
2046 ":__support_common",
2047 ":__support_fputil_dyadic_float",
2048 ":__support_uint128",
2049 ":common_constants",
2050 ],
2051 )
2052
2053 libc_support_library(
2054 name = "exp10f_impl",
2055 hdrs = ["src/math/generic/exp10f_impl.h"],
2056 deps = [
2057 ":__support_fputil_fma",
2058 ":__support_fputil_multiply_add",
2059 ":__support_fputil_rounding_mode",
2060 ":__support_macros_optimization",
2061 ":common_constants",
2062 ":explogxf",
2063 ],
2064 )
2065
2066 libc_support_library(
2067 name = "exp2f_impl",
2068 hdrs = ["src/math/generic/exp2f_impl.h"],
2069 deps = [
2070 ":__support_fputil_except_value_utils",
2071 ":__support_fputil_fma",
2072 ":__support_fputil_multiply_add",
2073 ":__support_fputil_nearest_integer",
2074 ":__support_fputil_polyeval",
2075 ":__support_fputil_rounding_mode",
2076 ":__support_macros_optimization",
2077 ":common_constants",
2078 ":explogxf",
2079 ],
2080 )
2081
2082 libc_support_library(
2083 name = "expxf16",
2084 hdrs = ["src/math/generic/expxf16.h"],
2085 deps = [
2086 ":__support_fputil_cast",
2087 ":__support_fputil_fp_bits",
2088 ":__support_fputil_nearest_integer",
2089 ":__support_math_expf16_utils",
2090 ],
2091 )
2092
2093 libc_support_library(
2094 name = "__support_math_exp_float_constants",
2095 hdrs = ["src/__support/math/exp_float_constants.h"],
2096 deps = [
2097 ":__support_macros_config",
2098 ],
2099 )
2100
2101 libc_support_library(
2102 name = "__support_math_expf",
2103 hdrs = ["src/__support/math/expf.h"],
2104 deps = [
2105 ":__support_common",
2106 ":__support_fputil_fenv_impl",
2107 ":__support_fputil_fp_bits",
2108 ":__support_fputil_multiply_add",
2109 ":__support_fputil_nearest_integer",
2110 ":__support_fputil_polyeval",
2111 ":__support_fputil_rounding_mode",
2112 ":__support_libc_errno",
2113 ":__support_macros_config",
2114 ":__support_macros_optimization",
2115 ":__support_math_exp_float_constants",
2116 ],
2117 )
2118
2119 libc_support_library(
2120 name = "__support_math_expf16_utils",
2121 hdrs = ["src/__support/math/expf16_utils.h"],
2122 deps = [
2123 ":__support_cpp_array",
2124 ":__support_fputil_nearest_integer",
2125 ":__support_fputil_polyeval",
2126 ":__support_macros_attributes",
2127 ":llvm_libc_macros_float16_macros"
2128 ],
2129 )
2130
2131 libc_support_library(
2132 name = "__support_math_expf16",
2133 hdrs = ["src/__support/math/expf16.h"],
2134 deps = [
2135 ":__support_common",
2136 ":__support_libc_errno",
2137 ":__support_cpp_array",
2138 ":__support_fputil_cast",
2139 ":__support_fputil_except_value_utils",
2140 ":__support_fputil_fenv_impl",
2141 ":__support_fputil_fp_bits",
2142 ":__support_fputil_multiply_add",
2143 ":__support_fputil_nearest_integer",
2144 ":__support_fputil_polyeval",
2145 ":__support_fputil_rounding_mode",
2146 ":__support_macros_optimization",
2147 ":__support_math_expf16_utils",
2148 ":llvm_libc_macros_float16_macros"
2149 ],
2150 )
2151
2152 libc_support_library(
2153 name = "__support_math_frexpf128",
2154 hdrs = ["src/__support/math/frexpf128.h"],
2155 deps = [
2156 ":__support_macros_properties_types",
2157 ":__support_fputil_manipulation_functions",
2158 ],
2159 )
2160
2161 libc_support_library(
2162 name = "__support_math_frexpf16",
2163 hdrs = ["src/__support/math/frexpf16.h"],
2164 deps = [
2165 ":__support_macros_config",
2166 ":__support_macros_properties_types",
2167 ":__support_fputil_manipulation_functions",
2168 ":llvm_libc_macros_float16_macros"
2169 ],
2170 )
2171
2172 libc_support_library(
2173 name = "__support_math_frexpf",
2174 hdrs = ["src/__support/math/frexpf.h"],
2175 deps = [
2176 ":__support_fputil_manipulation_functions",
2177 ],
2178 )
2179
2180 libc_support_library(
2181 name = "__support_math_ldexpf128",
2182 hdrs = ["src/__support/math/ldexpf128.h"],
2183 deps = [
2184 ":__support_fputil_manipulation_functions",
2185 ":__support_macros_properties_types",
2186 ":llvm_libc_types_float128"
2187 ],
2188 )
2189
2190 libc_support_library(
2191 name = "__support_math_ldexpf16",
2192 hdrs = ["src/__support/math/ldexpf16.h"],
2193 deps = [
2194 ":__support_macros_properties_types",
2195 ":__support_fputil_manipulation_functions",
2196 ":llvm_libc_macros_float16_macros"
2197 ],
2198 )
2199
2200 libc_support_library(
2201 name = "__support_math_ldexpf",
2202 hdrs = ["src/__support/math/ldexpf.h"],
2203 deps = [
2204 ":__support_fputil_manipulation_functions",
2205 ],
2206 )
2207
2208 ############################### complex targets ################################
2209
2210 libc_function(
2211 name = "cimag",
2212 srcs = ["src/complex/generic/cimag.cpp"],
2213 hdrs = ["src/complex/cimag.h"],
2214 deps = [
2215 ":__support_common",
2216 ":__support_complex_type",
2217 ":__support_cpp_bit",
2218 ":__support_macros_config",
2219 ],
2220 )
2221
2222 libc_function(
2223 name = "cimagf",
2224 srcs = ["src/complex/generic/cimagf.cpp"],
2225 hdrs = ["src/complex/cimagf.h"],
2226 deps = [
2227 ":__support_common",
2228 ":__support_complex_type",
2229 ":__support_cpp_bit",
2230 ":__support_macros_config",
2231 ],
2232 )
2233
2234 libc_function(
2235 name = "cimagf128",
2236 srcs = ["src/complex/generic/cimagf128.cpp"],
2237 hdrs = ["src/complex/cimagf128.h"],
2238 deps = [
2239 ":__support_common",
2240 ":__support_complex_type",
2241 ":__support_cpp_bit",
2242 ":__support_macros_config",
2243 ":__support_macros_properties_complex_types",
2244 ":__support_macros_properties_types",
2245 ],
2246 )
2247
2248 libc_function(
2249 name = "cimagf16",
2250 srcs = ["src/complex/generic/cimagf16.cpp"],
2251 hdrs = ["src/complex/cimagf16.h"],
2252 deps = [
2253 ":__support_common",
2254 ":__support_complex_type",
2255 ":__support_cpp_bit",
2256 ":__support_macros_config",
2257 ":__support_macros_properties_complex_types",
2258 ":__support_macros_properties_types",
2259 ],
2260 )
2261
2262 libc_function(
2263 name = "cimagl",
2264 srcs = ["src/complex/generic/cimagl.cpp"],
2265 hdrs = ["src/complex/cimagl.h"],
2266 deps = [
2267 ":__support_common",
2268 ":__support_complex_type",
2269 ":__support_cpp_bit",
2270 ":__support_macros_config",
2271 ],
2272 )
2273
2274 libc_function(
2275 name = "conj",
2276 srcs = ["src/complex/generic/conj.cpp"],
2277 hdrs = ["src/complex/conj.h"],
2278 deps = [
2279 ":__support_common",
2280 ":__support_complex_basic_ops",
2281 ":__support_macros_config",
2282 ],
2283 )
2284
2285 libc_function(
2286 name = "conjf",
2287 srcs = ["src/complex/generic/conjf.cpp"],
2288 hdrs = ["src/complex/conjf.h"],
2289 deps = [
2290 ":__support_common",
2291 ":__support_complex_basic_ops",
2292 ":__support_macros_config",
2293 ],
2294 )
2295
2296 libc_function(
2297 name = "conjf128",
2298 srcs = ["src/complex/generic/conjf128.cpp"],
2299 hdrs = ["src/complex/conjf128.h"],
2300 deps = [
2301 ":__support_common",
2302 ":__support_complex_basic_ops",
2303 ":__support_macros_config",
2304 ":__support_macros_properties_complex_types",
2305 ],
2306 )
2307
2308 libc_function(
2309 name = "conjf16",
2310 srcs = ["src/complex/generic/conjf16.cpp"],
2311 hdrs = ["src/complex/conjf16.h"],
2312 deps = [
2313 ":__support_common",
2314 ":__support_complex_basic_ops",
2315 ":__support_cpp_bit",
2316 ":__support_macros_config",
2317 ":__support_macros_properties_complex_types",
2318 ],
2319 )
2320
2321 libc_function(
2322 name = "conjl",
2323 srcs = ["src/complex/generic/conjl.cpp"],
2324 hdrs = ["src/complex/conjl.h"],
2325 deps = [
2326 ":__support_common",
2327 ":__support_complex_basic_ops",
2328 ":__support_macros_config",
2329 ],
2330 )
2331
2332 libc_function(
2333 name = "cproj",
2334 srcs = ["src/complex/generic/cproj.cpp"],
2335 hdrs = ["src/complex/cproj.h"],
2336 deps = [
2337 ":__support_common",
2338 ":__support_complex_basic_ops",
2339 ":__support_macros_config",
2340 ],
2341 )
2342
2343 libc_function(
2344 name = "cprojf",
2345 srcs = ["src/complex/generic/cprojf.cpp"],
2346 hdrs = ["src/complex/cprojf.h"],
2347 deps = [
2348 ":__support_common",
2349 ":__support_complex_basic_ops",
2350 ":__support_macros_config",
2351 ],
2352 )
2353
2354 libc_function(
2355 name = "cprojf128",
2356 srcs = ["src/complex/generic/cprojf128.cpp"],
2357 hdrs = ["src/complex/cprojf128.h"],
2358 deps = [
2359 ":__support_common",
2360 ":__support_complex_basic_ops",
2361 ":__support_macros_config",
2362 ":__support_macros_properties_complex_types",
2363 ],
2364 )
2365
2366 libc_function(
2367 name = "cprojf16",
2368 srcs = ["src/complex/generic/cprojf16.cpp"],
2369 hdrs = ["src/complex/cprojf16.h"],
2370 deps = [
2371 ":__support_common",
2372 ":__support_complex_basic_ops",
2373 ":__support_macros_config",
2374 ":__support_macros_properties_complex_types",
2375 ],
2376 )
2377
2378 libc_function(
2379 name = "cprojl",
2380 srcs = ["src/complex/generic/cprojl.cpp"],
2381 hdrs = ["src/complex/cprojl.h"],
2382 deps = [
2383 ":__support_common",
2384 ":__support_complex_basic_ops",
2385 ":__support_macros_config",
2386 ],
2387 )
2388
2389 libc_function(
2390 name = "creal",
2391 srcs = ["src/complex/generic/creal.cpp"],
2392 hdrs = ["src/complex/creal.h"],
2393 deps = [
2394 ":__support_common",
2395 ":__support_complex_type",
2396 ":__support_cpp_bit",
2397 ":__support_macros_config",
2398 ],
2399 )
2400
2401 libc_function(
2402 name = "crealf",
2403 srcs = ["src/complex/generic/crealf.cpp"],
2404 hdrs = ["src/complex/crealf.h"],
2405 deps = [
2406 ":__support_common",
2407 ":__support_complex_type",
2408 ":__support_cpp_bit",
2409 ":__support_macros_config",
2410 ],
2411 )
2412
2413 libc_function(
2414 name = "crealf128",
2415 srcs = ["src/complex/generic/crealf128.cpp"],
2416 hdrs = ["src/complex/crealf128.h"],
2417 deps = [
2418 ":__support_common",
2419 ":__support_complex_type",
2420 ":__support_cpp_bit",
2421 ":__support_macros_config",
2422 ":__support_macros_properties_complex_types",
2423 ],
2424 )
2425
2426 libc_function(
2427 name = "crealf16",
2428 srcs = ["src/complex/generic/crealf16.cpp"],
2429 hdrs = ["src/complex/crealf16.h"],
2430 deps = [
2431 ":__support_common",
2432 ":__support_complex_type",
2433 ":__support_cpp_bit",
2434 ":__support_macros_config",
2435 ":__support_macros_properties_complex_types",
2436 ],
2437 )
2438
2439 libc_function(
2440 name = "creall",
2441 srcs = ["src/complex/generic/creall.cpp"],
2442 hdrs = ["src/complex/creall.h"],
2443 deps = [
2444 ":__support_common",
2445 ":__support_complex_type",
2446 ":__support_cpp_bit",
2447 ":__support_macros_config",
2448 ],
2449 )
2450
2451 ################################ math targets ##################################
2452
2453 libc_math_function(
2454 name = "acosf",
2455 additional_deps = [
2456 ":__support_fputil_fma",
2457 ":__support_fputil_multiply_add",
2458 ":__support_fputil_nearest_integer",
2459 ":__support_fputil_polyeval",
2460 ":__support_fputil_sqrt",
2461 ":__support_macros_optimization",
2462 ":inv_trigf_utils",
2463 ],
2464 )
2465
2466 libc_math_function(
2467 name = "acosf16",
2468 additional_deps = [
2469 ":__support_fputil_cast",
2470 ":__support_fputil_fma",
2471 ":__support_fputil_multiply_add",
2472 ":__support_fputil_nearest_integer",
2473 ":__support_fputil_polyeval",
2474 ":__support_fputil_sqrt",
2475 ":__support_macros_optimization",
2476 ":inv_trigf_utils",
2477 ],
2478 )
2479
2480 libc_math_function(
2481 name = "acoshf",
2482 additional_deps = [
2483 ":__support_fputil_fma",
2484 ":__support_fputil_multiply_add",
2485 ":__support_fputil_nearest_integer",
2486 ":__support_fputil_polyeval",
2487 ":__support_fputil_sqrt",
2488 ":__support_macros_optimization",
2489 ":common_constants",
2490 ":explogxf",
2491 ],
2492 )
2493
2494 libc_math_function(
2495 name = "asinf",
2496 additional_deps = [
2497 ":__support_fputil_fma",
2498 ":__support_fputil_multiply_add",
2499 ":__support_fputil_nearest_integer",
2500 ":__support_fputil_polyeval",
2501 ":__support_fputil_sqrt",
2502 ":__support_macros_optimization",
2503 ":__support_macros_properties_cpu_features",
2504 ":inv_trigf_utils",
2505 ],
2506 )
2507
2508 libc_math_function(
2509 name = "asinf16",
2510 additional_deps = [
2511 ":__support_fputil_cast",
2512 ":__support_fputil_fma",
2513 ":__support_fputil_multiply_add",
2514 ":__support_fputil_nearest_integer",
2515 ":__support_fputil_polyeval",
2516 ":__support_fputil_sqrt",
2517 ":__support_macros_optimization",
2518 ":inv_trigf_utils",
2519 ],
2520 )
2521
2522 libc_math_function(
2523 name = "asinhf",
2524 additional_deps = [
2525 ":__support_fputil_fma",
2526 ":__support_fputil_multiply_add",
2527 ":__support_fputil_nearest_integer",
2528 ":__support_fputil_polyeval",
2529 ":__support_fputil_sqrt",
2530 ":__support_macros_optimization",
2531 ":common_constants",
2532 ":explogxf",
2533 ],
2534 )
2535
2536 libc_math_function(
2537 name = "atanf",
2538 additional_deps = [
2539 ":__support_fputil_fma",
2540 ":__support_fputil_multiply_add",
2541 ":__support_fputil_nearest_integer",
2542 ":__support_fputil_polyeval",
2543 ":__support_fputil_rounding_mode",
2544 ":__support_macros_optimization",
2545 ":inv_trigf_utils",
2546 ],
2547 )
2548
2549 libc_math_function(
2550 name = "atan",
2551 additional_deps = [
2552 ":__support_fputil_double_double",
2553 ":__support_fputil_nearest_integer",
2554 ":__support_macros_optimization",
2555 ":atan_utils",
2556 ],
2557 )
2558
2559 libc_math_function(
2560 name = "atan2f",
2561 additional_deps = [
2562 ":__support_fputil_double_double",
2563 ":__support_fputil_nearest_integer",
2564 ":inv_trigf_utils",
2565 ],
2566 )
2567
2568 libc_math_function(
2569 name = "atan2",
2570 additional_deps = [
2571 ":__support_fputil_double_double",
2572 ":__support_fputil_nearest_integer",
2573 ":atan_utils",
2574 ],
2575 )
2576
2577 libc_math_function(
2578 name = "atanhf",
2579 additional_deps = [
2580 ":__support_fputil_fma",
2581 ":__support_fputil_multiply_add",
2582 ":__support_fputil_nearest_integer",
2583 ":__support_fputil_polyeval",
2584 ":__support_macros_optimization",
2585 ":common_constants",
2586 ":explogxf",
2587 ],
2588 )
2589
2590 libc_math_function(name = "canonicalize")
2591
2592 libc_math_function(name = "canonicalizef")
2593
2594 libc_math_function(name = "canonicalizel")
2595
2596 libc_math_function(name = "canonicalizef128")
2597
2598 libc_math_function(name = "canonicalizef16")
2599
2600 libc_math_function(name = "iscanonical")
2601
2602 libc_math_function(name = "iscanonicalf")
2603
2604 libc_math_function(name = "iscanonicall")
2605
2606 libc_math_function(name = "iscanonicalf128")
2607
2608 libc_math_function(name = "iscanonicalf16")
2609
2610 libc_math_function(name = "issignaling")
2611
2612 libc_math_function(name = "issignalingf")
2613
2614 libc_math_function(name = "issignalingl")
2615
2616 libc_math_function(name = "issignalingf128")
2617
2618 libc_math_function(name = "issignalingf16")
2619
2620 libc_math_function(
2621 name = "cbrt",
2622 additional_deps = [
2623 ":__support_fputil_double_double",
2624 ":__support_fputil_polyeval",
2625 ":__support_integer_literals",
2626 ],
2627 )
2628
2629 libc_math_function(
2630 name = "cbrtf",
2631 additional_deps = [
2632 ":__support_fputil_polyeval",
2633 ],
2634 )
2635
2636 libc_math_function(name = "ceil")
2637
2638 libc_math_function(name = "ceilf")
2639
2640 libc_math_function(name = "ceill")
2641
2642 libc_math_function(name = "ceilf128")
2643
2644 libc_math_function(name = "ceilf16")
2645
2646 libc_math_function(name = "copysign")
2647
2648 libc_math_function(name = "copysignf")
2649
2650 libc_math_function(name = "copysignl")
2651
2652 libc_math_function(name = "copysignf128")
2653
2654 libc_math_function(name = "copysignf16")
2655
2656 libc_math_function(
2657 name = "cos",
2658 additional_deps = [
2659 ":__support_fputil_multiply_add",
2660 ":__support_macros_optimization",
2661 ":__support_macros_properties_cpu_features",
2662 ":range_reduction_double",
2663 ":sincos_eval",
2664 ],
2665 )
2666
2667 libc_math_function(
2668 name = "cosf",
2669 additional_deps = [
2670 ":__support_fputil_fma",
2671 ":__support_fputil_multiply_add",
2672 ":__support_macros_optimization",
2673 ":__support_macros_properties_cpu_features",
2674 ":sincosf_utils",
2675 ],
2676 )
2677
2678 libc_math_function(
2679 name = "cosf16",
2680 additional_deps = [
2681 ":__support_fputil_multiply_add",
2682 ":__support_macros_optimization",
2683 ":sincosf16_utils",
2684 ],
2685 )
2686
2687 libc_math_function(
2688 name = "coshf",
2689 additional_deps = [
2690 ":__support_fputil_fma",
2691 ":__support_fputil_multiply_add",
2692 ":__support_fputil_nearest_integer",
2693 ":__support_fputil_polyeval",
2694 ":__support_fputil_rounding_mode",
2695 ":__support_macros_optimization",
2696 ":common_constants",
2697 ":explogxf",
2698 ],
2699 )
2700
2701 libc_math_function(
2702 name = "coshf16",
2703 additional_deps = [
2704 ":expxf16",
2705 ],
2706 )
2707
2708 libc_math_function(
2709 name = "cospif",
2710 additional_deps = [
2711 ":__support_fputil_fma",
2712 ":__support_fputil_multiply_add",
2713 ":__support_fputil_nearest_integer",
2714 ":__support_fputil_polyeval",
2715 ":__support_fputil_rounding_mode",
2716 ":__support_macros_optimization",
2717 ":common_constants",
2718 ":explogxf",
2719 ":sincosf_utils",
2720 ],
2721 )
2722
2723 libc_math_function(
2724 name = "cospif16",
2725 additional_deps = [
2726 ":__support_fputil_multiply_add",
2727 ":__support_macros_optimization",
2728 ":sincosf16_utils",
2729 ],
2730 )
2731
2732 libc_math_function(name = "daddl")
2733
2734 libc_math_function(name = "daddf128")
2735
2736 libc_math_function(name = "ddivl")
2737
2738 libc_math_function(name = "ddivf128")
2739
2740 libc_math_function(
2741 name = "dfmal",
2742 additional_deps = [
2743 ":__support_fputil_fma",
2744 ],
2745 )
2746
2747 libc_math_function(
2748 name = "dfmaf128",
2749 additional_deps = [
2750 ":__support_fputil_fma",
2751 ],
2752 )
2753
2754 libc_math_function(name = "dmull")
2755
2756 libc_math_function(name = "dmulf128")
2757
2758 libc_math_function(
2759 name = "dsqrtl",
2760 additional_deps = [
2761 ":__support_fputil_sqrt",
2762 ],
2763 )
2764
2765 libc_math_function(
2766 name = "dsqrtf128",
2767 additional_deps = [
2768 ":__support_fputil_sqrt",
2769 ],
2770 )
2771
2772 libc_math_function(name = "dsubl")
2773
2774 libc_math_function(name = "dsubf128")
2775
2776 libc_math_function(
2777 name = "erff",
2778 additional_deps = [
2779 ":__support_fputil_multiply_add",
2780 ":__support_fputil_polyeval",
2781 ":__support_macros_optimization",
2782 ],
2783 )
2784
2785 libc_math_function(
2786 name = "exp",
2787 additional_deps = [
2788 ":__support_fputil_double_double",
2789 ":__support_fputil_dyadic_float",
2790 ":__support_fputil_multiply_add",
2791 ":__support_fputil_nearest_integer",
2792 ":__support_fputil_polyeval",
2793 ":__support_fputil_rounding_mode",
2794 ":__support_fputil_triple_double",
2795 ":__support_integer_literals",
2796 ":__support_macros_optimization",
2797 ":common_constants",
2798 ":explogxf",
2799 ],
2800 )
2801
2802 libc_math_function(
2803 name = "expf",
2804 additional_deps = [
2805 ":__support_math_expf",
2806 ":errno",
2807 ],
2808 )
2809
2810 libc_math_function(
2811 name = "expf16",
2812 additional_deps = [
2813 ":__support_math_expf16",
2814 ":expxf16",
2815 ],
2816 )
2817
2818 libc_math_function(
2819 name = "exp10",
2820 additional_deps = [
2821 ":__support_fputil_double_double",
2822 ":__support_fputil_dyadic_float",
2823 ":__support_fputil_multiply_add",
2824 ":__support_fputil_nearest_integer",
2825 ":__support_fputil_polyeval",
2826 ":__support_fputil_rounding_mode",
2827 ":__support_fputil_triple_double",
2828 ":__support_integer_literals",
2829 ":__support_macros_optimization",
2830 ":common_constants",
2831 ":explogxf",
2832 ],
2833 )
2834
2835 libc_math_function(
2836 name = "exp10f",
2837 additional_deps = [
2838 ":exp10f_impl",
2839 ],
2840 )
2841
2842 libc_math_function(
2843 name = "exp10f16",
2844 additional_deps = [
2845 ":expxf16",
2846 ],
2847 )
2848
2849 libc_math_function(
2850 name = "exp10m1f16",
2851 additional_deps = [
2852 ":expxf16",
2853 ],
2854 )
2855
2856 libc_math_function(
2857 name = "exp10m1f",
2858 additional_deps = [
2859 ":explogxf",
2860 ],
2861 )
2862
2863 libc_math_function(
2864 name = "exp2",
2865 additional_deps = [
2866 ":__support_fputil_double_double",
2867 ":__support_fputil_dyadic_float",
2868 ":__support_fputil_multiply_add",
2869 ":__support_fputil_nearest_integer",
2870 ":__support_fputil_polyeval",
2871 ":__support_fputil_rounding_mode",
2872 ":__support_fputil_triple_double",
2873 ":__support_integer_literals",
2874 ":__support_macros_optimization",
2875 ":common_constants",
2876 ":explogxf",
2877 ],
2878 )
2879
2880 libc_math_function(
2881 name = "exp2f",
2882 additional_deps = [
2883 ":exp2f_impl",
2884 ],
2885 )
2886
2887 libc_math_function(
2888 name = "exp2f16",
2889 additional_deps = [
2890 ":expxf16",
2891 ],
2892 )
2893
2894 libc_math_function(
2895 name = "exp2m1f",
2896 additional_deps = [
2897 ":__support_fputil_polyeval",
2898 ":explogxf",
2899 ],
2900 )
2901
2902 libc_math_function(
2903 name = "exp2m1f16",
2904 additional_deps = [
2905 ":expxf16",
2906 ],
2907 )
2908
2909 libc_math_function(
2910 name = "expm1",
2911 additional_deps = [
2912 ":__support_fputil_double_double",
2913 ":__support_fputil_dyadic_float",
2914 ":__support_fputil_multiply_add",
2915 ":__support_fputil_nearest_integer",
2916 ":__support_fputil_polyeval",
2917 ":__support_fputil_rounding_mode",
2918 ":__support_fputil_triple_double",
2919 ":__support_integer_literals",
2920 ":__support_macros_optimization",
2921 ":common_constants",
2922 ":explogxf",
2923 ],
2924 )
2925
2926 libc_math_function(
2927 name = "expm1f",
2928 additional_deps = [
2929 ":__support_fputil_fma",
2930 ":__support_fputil_multiply_add",
2931 ":__support_fputil_nearest_integer",
2932 ":__support_fputil_polyeval",
2933 ":__support_fputil_rounding_mode",
2934 ":__support_macros_optimization",
2935 ":__support_macros_properties_cpu_features",
2936 ":common_constants",
2937 ],
2938 )
2939
2940 libc_math_function(
2941 name = "expm1f16",
2942 additional_deps = [
2943 ":expxf16",
2944 ],
2945 )
2946
2947 libc_math_function(name = "f16add")
2948
2949 libc_math_function(name = "f16addf")
2950
2951 libc_math_function(name = "f16addf128")
2952
2953 libc_math_function(name = "f16addl")
2954
2955 libc_math_function(name = "f16div")
2956
2957 libc_math_function(name = "f16divf")
2958
2959 libc_math_function(name = "f16divf128")
2960
2961 libc_math_function(name = "f16divl")
2962
2963 libc_math_function(
2964 name = "f16fma",
2965 additional_deps = [
2966 ":__support_fputil_fma",
2967 ],
2968 )
2969
2970 libc_math_function(
2971 name = "f16fmaf",
2972 additional_deps = [
2973 ":__support_fputil_fma",
2974 ],
2975 )
2976
2977 libc_math_function(
2978 name = "f16fmaf128",
2979 additional_deps = [
2980 ":__support_fputil_fma",
2981 ],
2982 )
2983
2984 libc_math_function(
2985 name = "f16fmal",
2986 additional_deps = [
2987 ":__support_fputil_fma",
2988 ],
2989 )
2990
2991 libc_math_function(name = "f16mul")
2992
2993 libc_math_function(name = "f16mulf")
2994
2995 libc_math_function(name = "f16mulf128")
2996
2997 libc_math_function(name = "f16mull")
2998
2999 libc_math_function(
3000 name = "f16sqrt",
3001 additional_deps = [
3002 ":__support_fputil_sqrt",
3003 ],
3004 )
3005
3006 libc_math_function(
3007 name = "f16sqrtf",
3008 additional_deps = [
3009 ":__support_fputil_sqrt",
3010 ],
3011 )
3012
3013 libc_math_function(
3014 name = "f16sqrtf128",
3015 additional_deps = [
3016 ":__support_fputil_sqrt",
3017 ],
3018 )
3019
3020 libc_math_function(
3021 name = "f16sqrtl",
3022 additional_deps = [
3023 ":__support_fputil_sqrt",
3024 ],
3025 )
3026
3027 libc_math_function(name = "f16sub")
3028
3029 libc_math_function(name = "f16subf")
3030
3031 libc_math_function(name = "f16subf128")
3032
3033 libc_math_function(name = "f16subl")
3034
3035 libc_math_function(name = "fabs")
3036
3037 libc_math_function(name = "fabsf")
3038
3039 libc_math_function(name = "fabsl")
3040
3041 libc_math_function(name = "fabsf128")
3042
3043 libc_math_function(name = "fabsf16")
3044
3045 libc_math_function(name = "fadd")
3046
3047 libc_math_function(name = "faddl")
3048
3049 libc_math_function(name = "faddf128")
3050
3051 libc_math_function(name = "fdim")
3052
3053 libc_math_function(name = "fdimf")
3054
3055 libc_math_function(name = "fdiml")
3056
3057 libc_math_function(name = "fdimf128")
3058
3059 libc_math_function(name = "fdimf16")
3060
3061 libc_math_function(name = "fdiv")
3062
3063 libc_math_function(name = "fdivl")
3064
3065 libc_math_function(name = "fdivf128")
3066
3067 libc_math_function(
3068 name = "ffma",
3069 additional_deps = [
3070 ":__support_fputil_fma",
3071 ],
3072 )
3073
3074 libc_math_function(
3075 name = "ffmal",
3076 additional_deps = [
3077 ":__support_fputil_fma",
3078 ],
3079 )
3080
3081 libc_math_function(
3082 name = "ffmaf128",
3083 additional_deps = [
3084 ":__support_fputil_fma",
3085 ],
3086 )
3087
3088 libc_math_function(name = "floor")
3089
3090 libc_math_function(name = "floorf")
3091
3092 libc_math_function(name = "floorl")
3093
3094 libc_math_function(name = "floorf128")
3095
3096 libc_math_function(name = "floorf16")
3097
3098 # TODO: Add fma, fmaf, fmal, fmaf128 functions.
3099
3100 libc_math_function(
3101 name = "fmaf16",
3102 additional_deps = [
3103 ":__support_fputil_fma",
3104 ],
3105 )
3106
3107 libc_math_function(name = "fmax")
3108
3109 libc_math_function(name = "fmaxf")
3110
3111 libc_math_function(name = "fmaxl")
3112
3113 libc_math_function(name = "fmaxf128")
3114
3115 libc_math_function(name = "fmaxf16")
3116
3117 libc_math_function(name = "fmaximum")
3118
3119 libc_math_function(name = "fmaximumf")
3120
3121 libc_math_function(name = "fmaximuml")
3122
3123 libc_math_function(name = "fmaximumf128")
3124
3125 libc_math_function(name = "fmaximumf16")
3126
3127 libc_math_function(name = "fmaximum_mag")
3128
3129 libc_math_function(name = "fmaximum_magf")
3130
3131 libc_math_function(name = "fmaximum_magl")
3132
3133 libc_math_function(name = "fmaximum_magf128")
3134
3135 libc_math_function(name = "fmaximum_magf16")
3136
3137 libc_math_function(name = "fmaximum_mag_num")
3138
3139 libc_math_function(name = "fmaximum_mag_numf")
3140
3141 libc_math_function(name = "fmaximum_mag_numl")
3142
3143 libc_math_function(name = "fmaximum_mag_numf128")
3144
3145 libc_math_function(name = "fmaximum_mag_numf16")
3146
3147 libc_math_function(name = "fmaximum_num")
3148
3149 libc_math_function(name = "fmaximum_numf")
3150
3151 libc_math_function(name = "fmaximum_numl")
3152
3153 libc_math_function(name = "fmaximum_numf128")
3154
3155 libc_math_function(name = "fmaximum_numf16")
3156
3157 libc_math_function(name = "fmin")
3158
3159 libc_math_function(name = "fminf")
3160
3161 libc_math_function(name = "fminl")
3162
3163 libc_math_function(name = "fminf128")
3164
3165 libc_math_function(name = "fminf16")
3166
3167 libc_math_function(name = "fminimum")
3168
3169 libc_math_function(name = "fminimumf")
3170
3171 libc_math_function(name = "fminimuml")
3172
3173 libc_math_function(name = "fminimumf128")
3174
3175 libc_math_function(name = "fminimumf16")
3176
3177 libc_math_function(name = "fminimum_mag")
3178
3179 libc_math_function(name = "fminimum_magf")
3180
3181 libc_math_function(name = "fminimum_magl")
3182
3183 libc_math_function(name = "fminimum_magf128")
3184
3185 libc_math_function(name = "fminimum_magf16")
3186
3187 libc_math_function(name = "fminimum_mag_num")
3188
3189 libc_math_function(name = "fminimum_mag_numf")
3190
3191 libc_math_function(name = "fminimum_mag_numl")
3192
3193 libc_math_function(name = "fminimum_mag_numf128")
3194
3195 libc_math_function(name = "fminimum_mag_numf16")
3196
3197 libc_math_function(name = "fminimum_num")
3198
3199 libc_math_function(name = "fminimum_numf")
3200
3201 libc_math_function(name = "fminimum_numl")
3202
3203 libc_math_function(name = "fminimum_numf128")
3204
3205 libc_math_function(name = "fminimum_numf16")
3206
3207 libc_math_function(
3208 name = "fmod",
3209 additional_deps = [
3210 ":__support_fputil_generic_fmod",
3211 ],
3212 )
3213
3214 libc_math_function(
3215 name = "fmodf",
3216 additional_deps = [
3217 ":__support_fputil_generic_fmod",
3218 ],
3219 )
3220
3221 libc_math_function(
3222 name = "fmodl",
3223 additional_deps = [
3224 ":__support_fputil_generic_fmod",
3225 ],
3226 )
3227
3228 libc_math_function(
3229 name = "fmodf128",
3230 additional_deps = [
3231 ":__support_fputil_generic_fmod",
3232 ],
3233 )
3234
3235 libc_math_function(
3236 name = "fmodf16",
3237 additional_deps = [
3238 ":__support_fputil_generic_fmod",
3239 ],
3240 )
3241
3242 libc_math_function(
3243 name = "fmul",
3244 additional_deps = [
3245 ":__support_fputil_double_double",
3246 ],
3247 )
3248
3249 libc_math_function(name = "fmull")
3250
3251 libc_math_function(name = "fmulf128")
3252
3253 libc_math_function(name = "frexp")
3254
3255 libc_math_function(
3256 name = "frexpf",
3257 additional_deps = [
3258 ":__support_math_frexpf",
3259 ],
3260 )
3261
3262 libc_math_function(name = "frexpl")
3263
3264 libc_math_function(
3265 name = "frexpf128",
3266 additional_deps = [
3267 ":__support_math_frexpf128",
3268 ]
3269 )
3270
3271 libc_math_function(
3272 name = "frexpf16",
3273 additional_deps = [
3274 ":__support_math_frexpf16"
3275 ],
3276 )
3277
3278 libc_math_function(name = "fromfp")
3279
3280 libc_math_function(name = "fromfpf")
3281
3282 libc_math_function(name = "fromfpl")
3283
3284 libc_math_function(name = "fromfpf128")
3285
3286 libc_math_function(name = "fromfpf16")
3287
3288 libc_math_function(name = "fromfpx")
3289
3290 libc_math_function(name = "fromfpxf")
3291
3292 libc_math_function(name = "fromfpxl")
3293
3294 libc_math_function(name = "fromfpxf128")
3295
3296 libc_math_function(name = "fromfpxf16")
3297
3298 libc_math_function(
3299 name = "fsqrt",
3300 additional_deps = [
3301 ":__support_fputil_sqrt",
3302 ],
3303 )
3304
3305 libc_math_function(
3306 name = "fsqrtl",
3307 additional_deps = [
3308 ":__support_fputil_sqrt",
3309 ],
3310 )
3311
3312 libc_math_function(
3313 name = "fsqrtf128",
3314 additional_deps = [
3315 ":__support_fputil_sqrt",
3316 ],
3317 )
3318
3319 libc_math_function(name = "fsub")
3320
3321 libc_math_function(name = "fsubl")
3322
3323 libc_math_function(name = "fsubf128")
3324
3325 libc_math_function(name = "getpayload")
3326
3327 libc_math_function(name = "getpayloadf")
3328
3329 libc_math_function(name = "getpayloadl")
3330
3331 libc_math_function(name = "getpayloadf128")
3332
3333 libc_math_function(name = "getpayloadf16")
3334
3335 libc_math_function(name = "hypot")
3336
3337 libc_math_function(
3338 name = "hypotf",
3339 additional_deps = [
3340 ":__support_fputil_double_double",
3341 ":__support_fputil_sqrt",
3342 ],
3343 )
3344
3345 libc_math_function(name = "ilogb")
3346
3347 libc_math_function(name = "ilogbf")
3348
3349 libc_math_function(name = "ilogbl")
3350
3351 libc_math_function(name = "ilogbf128")
3352
3353 libc_math_function(name = "ilogbf16")
3354
3355 libc_math_function(name = "ldexp")
3356
3357 libc_math_function(
3358 name = "ldexpf",
3359 additional_deps = [
3360 ":__support_math_ldexpf",
3361 ]
3362 )
3363
3364 libc_math_function(name = "ldexpl")
3365
3366 libc_math_function(
3367 name = "ldexpf128",
3368 additional_deps = [
3369 ":__support_math_ldexpf128",
3370 ],
3371 )
3372
3373 libc_math_function(
3374 name = "ldexpf16",
3375 additional_deps = [
3376 ":__support_math_ldexpf16",
3377 ],
3378 )
3379
3380 libc_math_function(name = "llogb")
3381
3382 libc_math_function(name = "llogbf")
3383
3384 libc_math_function(name = "llogbl")
3385
3386 libc_math_function(name = "llogbf128")
3387
3388 libc_math_function(name = "llogbf16")
3389
3390 libc_math_function(name = "llrint")
3391
3392 libc_math_function(name = "llrintf")
3393
3394 libc_math_function(name = "llrintl")
3395
3396 libc_math_function(name = "llrintf128")
3397
3398 libc_math_function(name = "llrintf16")
3399
3400 libc_math_function(name = "llround")
3401
3402 libc_math_function(name = "llroundf")
3403
3404 libc_math_function(name = "llroundl")
3405
3406 libc_math_function(name = "llroundf128")
3407
3408 libc_math_function(name = "llroundf16")
3409
3410 libc_math_function(
3411 name = "log",
3412 additional_deps = [
3413 ":__support_fputil_double_double",
3414 ":__support_fputil_dyadic_float",
3415 ":__support_fputil_fma",
3416 ":__support_fputil_multiply_add",
3417 ":__support_fputil_polyeval",
3418 ":__support_integer_literals",
3419 ":__support_macros_optimization",
3420 ":__support_macros_properties_cpu_features",
3421 ":common_constants",
3422 ":log_range_reduction",
3423 ],
3424 )
3425
3426 libc_math_function(
3427 name = "logf",
3428 additional_deps = [
3429 ":__support_fputil_fma",
3430 ":__support_fputil_multiply_add",
3431 ":__support_fputil_polyeval",
3432 ":__support_macros_optimization",
3433 ":__support_macros_properties_cpu_features",
3434 ":common_constants",
3435 ],
3436 )
3437
3438 libc_math_function(
3439 name = "logf16",
3440 additional_deps = [
3441 ":expxf16",
3442 ],
3443 )
3444
3445 libc_math_function(
3446 name = "log10",
3447 additional_deps = [
3448 ":__support_fputil_double_double",
3449 ":__support_fputil_dyadic_float",
3450 ":__support_fputil_fma",
3451 ":__support_fputil_multiply_add",
3452 ":__support_fputil_polyeval",
3453 ":__support_integer_literals",
3454 ":__support_macros_optimization",
3455 ":__support_macros_properties_cpu_features",
3456 ":common_constants",
3457 ":log_range_reduction",
3458 ],
3459 )
3460
3461 libc_math_function(
3462 name = "log10f",
3463 additional_deps = [
3464 ":__support_fputil_fma",
3465 ":__support_fputil_multiply_add",
3466 ":__support_fputil_polyeval",
3467 ":__support_macros_optimization",
3468 ":__support_macros_properties_cpu_features",
3469 ":common_constants",
3470 ],
3471 )
3472
3473 libc_math_function(
3474 name = "log10f16",
3475 additional_deps = [
3476 ":expxf16",
3477 ],
3478 )
3479
3480 libc_math_function(
3481 name = "log1p",
3482 additional_deps = [
3483 ":__support_fputil_double_double",
3484 ":__support_fputil_dyadic_float",
3485 ":__support_fputil_fma",
3486 ":__support_fputil_multiply_add",
3487 ":__support_fputil_polyeval",
3488 ":__support_integer_literals",
3489 ":__support_macros_optimization",
3490 ":__support_macros_properties_cpu_features",
3491 ":common_constants",
3492 ],
3493 )
3494
3495 libc_math_function(
3496 name = "log1pf",
3497 additional_deps = [
3498 ":__support_fputil_fma",
3499 ":__support_fputil_multiply_add",
3500 ":__support_fputil_polyeval",
3501 ":__support_macros_optimization",
3502 ":__support_macros_properties_cpu_features",
3503 ":common_constants",
3504 ],
3505 )
3506
3507 libc_math_function(
3508 name = "log2",
3509 additional_deps = [
3510 ":__support_fputil_double_double",
3511 ":__support_fputil_dyadic_float",
3512 ":__support_fputil_fma",
3513 ":__support_fputil_multiply_add",
3514 ":__support_fputil_polyeval",
3515 ":__support_integer_literals",
3516 ":__support_macros_optimization",
3517 ":__support_macros_properties_cpu_features",
3518 ":common_constants",
3519 ":log_range_reduction",
3520 ],
3521 )
3522
3523 libc_math_function(
3524 name = "log2f",
3525 additional_deps = [
3526 ":__support_fputil_fma",
3527 ":__support_fputil_multiply_add",
3528 ":__support_fputil_polyeval",
3529 ":__support_macros_optimization",
3530 ":common_constants",
3531 ],
3532 )
3533
3534 libc_math_function(
3535 name = "log2f16",
3536 additional_deps = [
3537 ":expxf16",
3538 ],
3539 )
3540
3541 libc_math_function(name = "logb")
3542
3543 libc_math_function(name = "logbf")
3544
3545 libc_math_function(name = "logbl")
3546
3547 libc_math_function(name = "logbf128")
3548
3549 libc_math_function(name = "logbf16")
3550
3551 libc_math_function(name = "lrint")
3552
3553 libc_math_function(name = "lrintf")
3554
3555 libc_math_function(name = "lrintl")
3556
3557 libc_math_function(name = "lrintf128")
3558
3559 libc_math_function(name = "lrintf16")
3560
3561 libc_math_function(name = "lround")
3562
3563 libc_math_function(name = "lroundf")
3564
3565 libc_math_function(name = "lroundl")
3566
3567 libc_math_function(name = "lroundf128")
3568
3569 libc_math_function(name = "lroundf16")
3570
3571 libc_math_function(name = "modf")
3572
3573 libc_math_function(name = "modff")
3574
3575 libc_math_function(name = "modfl")
3576
3577 libc_math_function(name = "modff128")
3578
3579 libc_math_function(name = "modff16")
3580
3581 libc_math_function(
3582 name = "nan",
3583 additional_deps = [
3584 ":__support_str_to_float",
3585 ":errno",
3586 ],
3587 )
3588
3589 libc_math_function(
3590 name = "nanf",
3591 additional_deps = [
3592 ":__support_str_to_float",
3593 ":errno",
3594 ],
3595 )
3596
3597 libc_math_function(
3598 name = "nanl",
3599 additional_deps = [
3600 ":__support_str_to_float",
3601 ":errno",
3602 ],
3603 )
3604
3605 libc_math_function(
3606 name = "nanf128",
3607 additional_deps = [
3608 ":__support_str_to_float",
3609 ":errno",
3610 ],
3611 )
3612
3613 libc_math_function(
3614 name = "nanf16",
3615 additional_deps = [
3616 ":__support_str_to_float",
3617 ":errno",
3618 ],
3619 )
3620
3621 libc_math_function(name = "nearbyint")
3622
3623 libc_math_function(name = "nearbyintf")
3624
3625 libc_math_function(name = "nearbyintl")
3626
3627 libc_math_function(name = "nearbyintf128")
3628
3629 libc_math_function(name = "nearbyintf16")
3630
3631 libc_math_function(name = "nextafter")
3632
3633 libc_math_function(name = "nextafterf")
3634
3635 libc_math_function(name = "nextafterl")
3636
3637 libc_math_function(name = "nextafterf128")
3638
3639 libc_math_function(name = "nextafterf16")
3640
3641 libc_math_function(name = "nextdown")
3642
3643 libc_math_function(name = "nextdownf")
3644
3645 libc_math_function(name = "nextdownl")
3646
3647 libc_math_function(name = "nextdownf128")
3648
3649 libc_math_function(name = "nextdownf16")
3650
3651 libc_math_function(name = "nexttoward")
3652
3653 libc_math_function(name = "nexttowardf")
3654
3655 libc_math_function(name = "nexttowardf16")
3656
3657 libc_math_function(name = "nexttowardl")
3658
3659 libc_math_function(name = "nextup")
3660
3661 libc_math_function(name = "nextupf")
3662
3663 libc_math_function(name = "nextupl")
3664
3665 libc_math_function(name = "nextupf128")
3666
3667 libc_math_function(name = "nextupf16")
3668
3669 libc_math_function(
3670 name = "pow",
3671 additional_deps = [
3672 ":__support_fputil_double_double",
3673 ":__support_fputil_nearest_integer",
3674 ":__support_fputil_polyeval",
3675 ":__support_fputil_sqrt",
3676 ":common_constants",
3677 ],
3678 )
3679
3680 libc_math_function(
3681 name = "powf",
3682 additional_deps = [
3683 ":__support_fputil_double_double",
3684 ":__support_fputil_multiply_add",
3685 ":__support_fputil_nearest_integer",
3686 ":__support_fputil_polyeval",
3687 ":__support_fputil_rounding_mode",
3688 ":__support_fputil_sqrt",
3689 ":__support_fputil_triple_double",
3690 ":__support_macros_optimization",
3691 ":common_constants",
3692 ":explogxf",
3693 ":exp2f_impl",
3694 ":exp10f_impl",
3695 ],
3696 )
3697
3698 libc_math_function(name = "remainder")
3699
3700 libc_math_function(name = "remainderf")
3701
3702 libc_math_function(name = "remainderl")
3703
3704 libc_math_function(name = "remainderf128")
3705
3706 libc_math_function(name = "remainderf16")
3707
3708 libc_math_function(name = "remquo")
3709
3710 libc_math_function(name = "remquof")
3711
3712 libc_math_function(name = "remquol")
3713
3714 libc_math_function(name = "remquof128")
3715
3716 libc_math_function(name = "remquof16")
3717
3718 libc_math_function(name = "rint")
3719
3720 libc_math_function(name = "rintf")
3721
3722 libc_math_function(name = "rintl")
3723
3724 libc_math_function(name = "rintf128")
3725
3726 libc_math_function(name = "rintf16")
3727
3728 libc_math_function(name = "round")
3729
3730 libc_math_function(name = "roundf")
3731
3732 libc_math_function(name = "roundl")
3733
3734 libc_math_function(name = "roundf128")
3735
3736 libc_math_function(name = "roundf16")
3737
3738 libc_math_function(name = "roundeven")
3739
3740 libc_math_function(name = "roundevenf")
3741
3742 libc_math_function(name = "roundevenl")
3743
3744 libc_math_function(name = "roundevenf128")
3745
3746 libc_math_function(name = "roundevenf16")
3747
3748 libc_math_function(name = "scalbln")
3749
3750 libc_math_function(name = "scalblnf")
3751
3752 libc_math_function(name = "scalblnl")
3753
3754 libc_math_function(name = "scalblnf128")
3755
3756 libc_math_function(name = "scalblnf16")
3757
3758 libc_math_function(name = "scalbn")
3759
3760 libc_math_function(name = "scalbnf")
3761
3762 libc_math_function(name = "scalbnl")
3763
3764 libc_math_function(name = "scalbnf128")
3765
3766 libc_math_function(name = "scalbnf16")
3767
3768 libc_math_function(name = "setpayload")
3769
3770 libc_math_function(name = "setpayloadf")
3771
3772 libc_math_function(name = "setpayloadl")
3773
3774 libc_math_function(name = "setpayloadf128")
3775
3776 libc_math_function(name = "setpayloadf16")
3777
3778 libc_math_function(name = "setpayloadsig")
3779
3780 libc_math_function(name = "setpayloadsigf")
3781
3782 libc_math_function(name = "setpayloadsigl")
3783
3784 libc_math_function(name = "setpayloadsigf128")
3785
3786 libc_math_function(name = "setpayloadsigf16")
3787
3788 libc_math_function(
3789 name = "sin",
3790 additional_deps = [
3791 ":__support_fputil_multiply_add",
3792 ":__support_macros_optimization",
3793 ":__support_macros_properties_cpu_features",
3794 ":range_reduction_double",
3795 ":sincos_eval",
3796 ],
3797 )
3798
3799 libc_math_function(
3800 name = "sinf",
3801 additional_deps = [
3802 ":__support_fputil_fma",
3803 ":__support_fputil_multiply_add",
3804 ":__support_fputil_polyeval",
3805 ":__support_fputil_rounding_mode",
3806 ":__support_macros_optimization",
3807 ":__support_macros_properties_cpu_features",
3808 ":range_reduction",
3809 ":sincosf_utils",
3810 ],
3811 )
3812
3813 libc_math_function(
3814 name = "sinf16",
3815 additional_deps = [
3816 ":__support_fputil_nearest_integer",
3817 ":__support_fputil_polyeval",
3818 ":sincosf16_utils",
3819 ],
3820 )
3821
3822 libc_math_function(
3823 name = "sincos",
3824 additional_deps = [
3825 ":__support_fputil_multiply_add",
3826 ":__support_macros_optimization",
3827 ":__support_macros_properties_cpu_features",
3828 ":range_reduction_double",
3829 ":sincos_eval",
3830 ],
3831 )
3832
3833 libc_math_function(
3834 name = "sincosf",
3835 additional_deps = [
3836 ":__support_fputil_fma",
3837 ":__support_fputil_multiply_add",
3838 ":__support_fputil_rounding_mode",
3839 ":__support_macros_optimization",
3840 ":__support_macros_properties_cpu_features",
3841 ":sincosf_utils",
3842 ],
3843 )
3844
3845 libc_math_function(
3846 name = "sinhf",
3847 additional_deps = [
3848 ":__support_fputil_fma",
3849 ":__support_fputil_multiply_add",
3850 ":__support_fputil_nearest_integer",
3851 ":__support_fputil_polyeval",
3852 ":__support_fputil_rounding_mode",
3853 ":__support_macros_optimization",
3854 ":common_constants",
3855 ":explogxf",
3856 ],
3857 )
3858
3859 libc_math_function(
3860 name = "sinhf16",
3861 additional_deps = [
3862 ":expxf16",
3863 ],
3864 )
3865
3866 libc_math_function(
3867 name = "sinpif",
3868 additional_deps = [
3869 ":sincosf_utils",
3870 ],
3871 )
3872
3873 libc_math_function(
3874 name = "sinpif16",
3875 additional_deps = [
3876 ":__support_fputil_nearest_integer",
3877 ":__support_fputil_polyeval",
3878 ":sincosf16_utils",
3879 ],
3880 )
3881
3882 libc_math_function(
3883 name = "sqrt",
3884 additional_deps = [
3885 ":__support_fputil_sqrt",
3886 ],
3887 )
3888
3889 libc_math_function(
3890 name = "sqrtf",
3891 additional_deps = [
3892 ":__support_fputil_sqrt",
3893 ],
3894 )
3895
3896 libc_math_function(
3897 name = "sqrtl",
3898 additional_deps = [
3899 ":__support_fputil_sqrt",
3900 ],
3901 )
3902
3903 libc_math_function(
3904 name = "sqrtf128",
3905 additional_deps = [
3906 ":__support_fputil_sqrt",
3907 ],
3908 )
3909
3910 libc_math_function(
3911 name = "sqrtf16",
3912 additional_deps = [
3913 ":__support_fputil_sqrt",
3914 ],
3915 )
3916
3917 libc_math_function(
3918 name = "tan",
3919 additional_deps = [
3920 ":__support_fputil_multiply_add",
3921 ":__support_macros_optimization",
3922 ":__support_macros_properties_cpu_features",
3923 ":range_reduction_double",
3924 ":sincos_eval",
3925 ],
3926 )
3927
3928 libc_math_function(
3929 name = "tanf",
3930 additional_deps = [
3931 ":__support_fputil_fma",
3932 ":__support_fputil_multiply_add",
3933 ":__support_fputil_nearest_integer",
3934 ":__support_fputil_polyeval",
3935 ":__support_macros_optimization",
3936 ":__support_macros_properties_cpu_features",
3937 ":range_reduction",
3938 ":sincosf_utils",
3939 ],
3940 )
3941
3942 libc_math_function(
3943 name = "tanf16",
3944 additional_deps = [
3945 ":__support_fputil_nearest_integer",
3946 ":__support_fputil_polyeval",
3947 ":sincosf16_utils",
3948 ],
3949 )
3950
3951 libc_math_function(
3952 name = "tanhf",
3953 additional_deps = [
3954 ":__support_fputil_fma",
3955 ":__support_fputil_multiply_add",
3956 ":__support_fputil_nearest_integer",
3957 ":__support_fputil_polyeval",
3958 ":__support_fputil_rounding_mode",
3959 ":__support_macros_optimization",
3960 ":__support_macros_properties_cpu_features",
3961 ":common_constants",
3962 ":explogxf",
3963 ],
3964 )
3965
3966 libc_math_function(
3967 name = "tanhf16",
3968 additional_deps = [
3969 ":expxf16",
3970 ],
3971 )
3972
3973 libc_math_function(
3974 name = "tanpif16",
3975 additional_deps = [
3976 ":sincosf16_utils",
3977 ":hdr_errno_macros",
3978 ":hdr_fenv_macros",
3979 ":__support_fputil_cast",
3980 ":__support_fputil_multiply_add",
3981 ],
3982 )
3983
3984 libc_math_function(name = "totalorder")
3985
3986 libc_math_function(name = "totalorderf")
3987
3988 libc_math_function(name = "totalorderl")
3989
3990 libc_math_function(name = "totalorderf128")
3991
3992 libc_math_function(name = "totalorderf16")
3993
3994 libc_math_function(name = "totalordermag")
3995
3996 libc_math_function(name = "totalordermagf")
3997
3998 libc_math_function(name = "totalordermagl")
3999
4000 libc_math_function(name = "totalordermagf128")
4001
4002 libc_math_function(name = "totalordermagf16")
4003
4004 libc_math_function(name = "trunc")
4005
4006 libc_math_function(name = "truncf")
4007
4008 libc_math_function(name = "truncl")
4009
4010 libc_math_function(name = "truncf128")
4011
4012 libc_math_function(name = "truncf16")
4013
4014 libc_math_function(name = "ufromfp")
4015
4016 libc_math_function(name = "ufromfpf")
4017
4018 libc_math_function(name = "ufromfpl")
4019
4020 libc_math_function(name = "ufromfpf128")
4021
4022 libc_math_function(name = "ufromfpf16")
4023
4024 libc_math_function(name = "ufromfpx")
4025
4026 libc_math_function(name = "ufromfpxf")
4027
4028 libc_math_function(name = "ufromfpxl")
4029
4030 libc_math_function(name = "ufromfpxf128")
4031
4032 libc_math_function(name = "ufromfpxf16")
4033
4034 ############################## inttypes targets ##############################
4035
4036 libc_function(
4037 name = "imaxabs",
4038 srcs = ["src/inttypes/imaxabs.cpp"],
4039 hdrs = ["src/inttypes/imaxabs.h"],
4040 deps = [
4041 ":__support_common",
4042 ":__support_integer_operations",
4043 ],
4044 )
4045
4046 libc_function(
4047 name = "imaxdiv",
4048 srcs = ["src/inttypes/imaxdiv.cpp"],
4049 hdrs = ["src/inttypes/imaxdiv.h"],
4050 deps = [
4051 ":__support_common",
4052 ":__support_integer_operations",
4053 ],
4054 )
4055
4056 ############################### stdbit targets ###############################
4057
4058 bit_suffix_list = [
4059 "uc",
4060 "us",
4061 "ui",
4062 "ul",
4063 "ull",
4064 ]
4065
4066 bit_prefix_list = [
4067 "stdc_leading_zeros_",
4068 "stdc_leading_ones_",
4069 "stdc_trailing_zeros_",
4070 "stdc_trailing_ones_",
4071 "stdc_count_ones_",
4072 "stdc_has_single_bit_",
4073 "stdc_bit_width_",
4074 "stdc_bit_floor_",
4075 "stdc_bit_ceil_",
4076 ]
4077
4078 bit_prefix_needs_math_list = [
4079 "stdc_first_leading_zero_",
4080 "stdc_first_leading_one_",
4081 "stdc_first_trailing_zero_",
4082 "stdc_first_trailing_one_",
4083 "stdc_count_zeros_",
4084 ]
4085
4086 [
4087 libc_function(
4088 name = bit_prefix + bit_suffix,
4089 srcs = ["src/stdbit/" + bit_prefix + bit_suffix + ".cpp"],
4090 hdrs = ["src/stdbit/" + bit_prefix + bit_suffix + ".h"],
4091 deps = [
4092 ":__support_common",
4093 ":__support_cpp_bit",
4094 ],
4095 )
4096 for bit_prefix in bit_prefix_list
4097 for bit_suffix in bit_suffix_list
4098 ]
4099
4100 [
4101 libc_function(
4102 name = bit_prefix + bit_suffix,
4103 srcs = ["src/stdbit/" + bit_prefix + bit_suffix + ".cpp"],
4104 hdrs = ["src/stdbit/" + bit_prefix + bit_suffix + ".h"],
4105 deps = [
4106 ":__support_common",
4107 ":__support_math_extras",
4108 ],
4109 )
4110 for bit_prefix in bit_prefix_needs_math_list
4111 for bit_suffix in bit_suffix_list
4112 ]
4113
4114 ############################### stdlib targets ###############################
4115
4116 libc_function(
4117 name = "abs",
4118 srcs = ["src/stdlib/abs.cpp"],
4119 hdrs = ["src/stdlib/abs.h"],
4120 deps = [
4121 ":__support_common",
4122 ":__support_integer_operations",
4123 ],
4124 )
4125
4126 libc_function(
4127 name = "labs",
4128 srcs = ["src/stdlib/labs.cpp"],
4129 hdrs = ["src/stdlib/labs.h"],
4130 deps = [
4131 ":__support_common",
4132 ":__support_integer_operations",
4133 ],
4134 )
4135
4136 libc_function(
4137 name = "llabs",
4138 srcs = ["src/stdlib/llabs.cpp"],
4139 hdrs = ["src/stdlib/llabs.h"],
4140 deps = [
4141 ":__support_common",
4142 ":__support_integer_operations",
4143 ],
4144 )
4145
4146 libc_function(
4147 name = "div",
4148 srcs = ["src/stdlib/div.cpp"],
4149 hdrs = ["src/stdlib/div.h"],
4150 deps = [
4151 ":__support_common",
4152 ":__support_integer_operations",
4153 ":types_div_t",
4154 ],
4155 )
4156
4157 libc_function(
4158 name = "ldiv",
4159 srcs = ["src/stdlib/ldiv.cpp"],
4160 hdrs = ["src/stdlib/ldiv.h"],
4161 deps = [
4162 ":__support_common",
4163 ":__support_integer_operations",
4164 ":types_ldiv_t",
4165 ],
4166 )
4167
4168 libc_function(
4169 name = "lldiv",
4170 srcs = ["src/stdlib/lldiv.cpp"],
4171 hdrs = ["src/stdlib/lldiv.h"],
4172 deps = [
4173 ":__support_common",
4174 ":__support_integer_operations",
4175 ":types_lldiv_t",
4176 ],
4177 )
4178
4179 libc_function(
4180 name = "atoi",
4181 srcs = ["src/stdlib/atoi.cpp"],
4182 hdrs = ["src/stdlib/atoi.h"],
4183 deps = [
4184 ":__support_common",
4185 ":__support_str_to_integer",
4186 ":errno",
4187 ],
4188 )
4189
4190 libc_function(
4191 name = "atol",
4192 srcs = ["src/stdlib/atol.cpp"],
4193 hdrs = ["src/stdlib/atol.h"],
4194 deps = [
4195 ":__support_common",
4196 ":__support_str_to_integer",
4197 ":errno",
4198 ],
4199 )
4200
4201 libc_function(
4202 name = "atoll",
4203 srcs = ["src/stdlib/atoll.cpp"],
4204 hdrs = ["src/stdlib/atoll.h"],
4205 deps = [
4206 ":__support_common",
4207 ":__support_str_to_integer",
4208 ":errno",
4209 ],
4210 )
4211
4212 libc_function(
4213 name = "atof",
4214 srcs = ["src/stdlib/atof.cpp"],
4215 hdrs = ["src/stdlib/atof.h"],
4216 deps = [
4217 ":__support_common",
4218 ":__support_str_to_float",
4219 ":errno",
4220 ],
4221 )
4222
4223 libc_function(
4224 name = "bsearch",
4225 srcs = ["src/stdlib/bsearch.cpp"],
4226 hdrs = ["src/stdlib/bsearch.h"],
4227 deps = [
4228 ":__support_common",
4229 ],
4230 )
4231
4232 libc_support_library(
4233 name = "qsort_util",
4234 hdrs = [
4235 "src/stdlib/heap_sort.h",
4236 "src/stdlib/qsort_data.h",
4237 "src/stdlib/qsort_pivot.h",
4238 "src/stdlib/qsort_util.h",
4239 "src/stdlib/quick_sort.h",
4240 ],
4241 deps = [
4242 ":__support_common",
4243 ":__support_cpp_bit",
4244 ":__support_cpp_cstddef",
4245 ":__support_macros_attributes",
4246 ],
4247 )
4248
4249 libc_function(
4250 name = "qsort",
4251 srcs = ["src/stdlib/qsort.cpp"],
4252 hdrs = ["src/stdlib/qsort.h"],
4253 deps = [
4254 ":__support_common",
4255 ":qsort_util",
4256 ":types_size_t",
4257 ],
4258 )
4259
4260 libc_function(
4261 name = "qsort_r",
4262 srcs = ["src/stdlib/qsort_r.cpp"],
4263 hdrs = ["src/stdlib/qsort_r.h"],
4264 deps = [
4265 ":__support_common",
4266 ":qsort_util",
4267 ":types_size_t",
4268 ],
4269 )
4270
4271 libc_support_library(
4272 name = "str_from_util",
4273 hdrs = ["src/stdlib/str_from_util.h"],
4274 deps = [
4275 ":__support_common",
4276 ":__support_cpp_type_traits",
4277 ":__support_str_to_integer",
4278 ":printf_converter",
4279 ":printf_core_structs",
4280 ":printf_writer",
4281 ],
4282 )
4283
4284 libc_function(
4285 name = "strfromf",
4286 srcs = ["src/stdlib/strfromf.cpp"],
4287 hdrs = ["src/stdlib/strfromf.h"],
4288 deps = [
4289 ":__support_common",
4290 ":str_from_util",
4291 ],
4292 )
4293
4294 libc_function(
4295 name = "strfromd",
4296 srcs = ["src/stdlib/strfromd.cpp"],
4297 hdrs = ["src/stdlib/strfromd.h"],
4298 deps = [
4299 ":__support_common",
4300 ":str_from_util",
4301 ],
4302 )
4303
4304 libc_function(
4305 name = "strfroml",
4306 srcs = ["src/stdlib/strfroml.cpp"],
4307 hdrs = ["src/stdlib/strfroml.h"],
4308 deps = [
4309 ":__support_common",
4310 ":str_from_util",
4311 ],
4312 )
4313
4314 libc_function(
4315 name = "strtol",
4316 srcs = ["src/stdlib/strtol.cpp"],
4317 hdrs = ["src/stdlib/strtol.h"],
4318 deps = [
4319 ":__support_common",
4320 ":__support_str_to_integer",
4321 ":errno",
4322 ],
4323 )
4324
4325 libc_function(
4326 name = "strtoll",
4327 srcs = ["src/stdlib/strtoll.cpp"],
4328 hdrs = ["src/stdlib/strtoll.h"],
4329 deps = [
4330 ":__support_common",
4331 ":__support_str_to_integer",
4332 ":errno",
4333 ],
4334 )
4335
4336 libc_function(
4337 name = "strtoul",
4338 srcs = ["src/stdlib/strtoul.cpp"],
4339 hdrs = ["src/stdlib/strtoul.h"],
4340 deps = [
4341 ":__support_common",
4342 ":__support_str_to_integer",
4343 ":errno",
4344 ],
4345 )
4346
4347 libc_function(
4348 name = "strtoull",
4349 srcs = ["src/stdlib/strtoull.cpp"],
4350 hdrs = ["src/stdlib/strtoull.h"],
4351 deps = [
4352 ":__support_common",
4353 ":__support_str_to_integer",
4354 ":errno",
4355 ],
4356 )
4357
4358 libc_function(
4359 name = "strtof",
4360 srcs = ["src/stdlib/strtof.cpp"],
4361 hdrs = ["src/stdlib/strtof.h"],
4362 deps = [
4363 ":__support_common",
4364 ":__support_str_to_float",
4365 ":errno",
4366 ],
4367 )
4368
4369 libc_function(
4370 name = "strtod",
4371 srcs = ["src/stdlib/strtod.cpp"],
4372 hdrs = ["src/stdlib/strtod.h"],
4373 deps = [
4374 ":__support_common",
4375 ":__support_str_to_float",
4376 ":errno",
4377 ],
4378 )
4379
4380 libc_function(
4381 name = "strtold",
4382 srcs = ["src/stdlib/strtold.cpp"],
4383 hdrs = ["src/stdlib/strtold.h"],
4384 deps = [
4385 ":__support_common",
4386 ":__support_str_to_float",
4387 ":errno",
4388 ],
4389 )
4390
4391 ############################### string targets ###############################
4392
4393 libc_support_library(
4394 name = "string_memory_utils",
4395 hdrs = [
4396 "src/string/memory_utils/op_aarch64.h",
4397 "src/string/memory_utils/op_builtin.h",
4398 "src/string/memory_utils/op_generic.h",
4399 "src/string/memory_utils/op_riscv.h",
4400 "src/string/memory_utils/op_x86.h",
4401 "src/string/memory_utils/utils.h",
4402 ],
4403 textual_hdrs = [
4404 "src/string/memory_utils/aarch64/inline_bcmp.h",
4405 "src/string/memory_utils/aarch64/inline_memcmp.h",
4406 "src/string/memory_utils/aarch64/inline_memcpy.h",
4407 "src/string/memory_utils/aarch64/inline_memmove.h",
4408 "src/string/memory_utils/aarch64/inline_memset.h",
4409 "src/string/memory_utils/arm/inline_memcpy.h",
4410 "src/string/memory_utils/generic/aligned_access.h",
4411 "src/string/memory_utils/generic/byte_per_byte.h",
4412 "src/string/memory_utils/inline_bcmp.h",
4413 "src/string/memory_utils/inline_bzero.h",
4414 "src/string/memory_utils/inline_memcmp.h",
4415 "src/string/memory_utils/inline_memcpy.h",
4416 "src/string/memory_utils/inline_memmem.h",
4417 "src/string/memory_utils/inline_memmove.h",
4418 "src/string/memory_utils/inline_memset.h",
4419 "src/string/memory_utils/inline_strcmp.h",
4420 "src/string/memory_utils/inline_strstr.h",
4421 "src/string/memory_utils/riscv/inline_bcmp.h",
4422 "src/string/memory_utils/riscv/inline_memcmp.h",
4423 "src/string/memory_utils/riscv/inline_memcpy.h",
4424 "src/string/memory_utils/riscv/inline_memmove.h",
4425 "src/string/memory_utils/riscv/inline_memset.h",
4426 "src/string/memory_utils/x86_64/inline_bcmp.h",
4427 "src/string/memory_utils/x86_64/inline_memcmp.h",
4428 "src/string/memory_utils/x86_64/inline_memcpy.h",
4429 "src/string/memory_utils/x86_64/inline_memmove.h",
4430 "src/string/memory_utils/x86_64/inline_memset.h",
4431 ],
4432 deps = [
4433 ":__support_common",
4434 ":__support_cpp_array",
4435 ":__support_cpp_bit",
4436 ":__support_cpp_cstddef",
4437 ":__support_cpp_type_traits",
4438 ":__support_macros_attributes",
4439 ":__support_macros_optimization",
4440 ":__support_macros_properties_architectures",
4441 ":__support_macros_properties_cpu_features",
4442 ],
4443 )
4444
4445 libc_support_library(
4446 name = "string_utils",
4447 hdrs = ["src/string/string_utils.h"],
4448 deps = [
4449 ":__support_common",
4450 ":__support_cpp_bitset",
4451 ":__support_cpp_type_traits",
4452 ":__support_macros_optimization",
4453 ":hdr_limits_macros",
4454 ":llvm_libc_types_size_t",
4455 ":types_size_t",
4456 ],
4457 )
4458
4459 libc_function(
4460 name = "memchr",
4461 srcs = ["src/string/memchr.cpp"],
4462 hdrs = ["src/string/memchr.h"],
4463 deps = [
4464 ":__support_common",
4465 ":__support_macros_null_check",
4466 ":string_utils",
4467 ],
4468 )
4469
4470 libc_function(
4471 name = "memcpy",
4472 srcs = ["src/string/memcpy.cpp"],
4473 hdrs = ["src/string/memcpy.h"],
4474 deps = [
4475 ":__support_common",
4476 ":__support_macros_null_check",
4477 ":string_memory_utils",
4478 ],
4479 )
4480
4481 libc_function(
4482 name = "memset",
4483 srcs = ["src/string/memset.cpp"],
4484 hdrs = ["src/string/memset.h"],
4485 deps = [
4486 ":__support_common",
4487 ":__support_macros_null_check",
4488 ":string_memory_utils",
4489 ],
4490 )
4491
4492 libc_function(
4493 name = "memmove",
4494 srcs = ["src/string/memmove.cpp"],
4495 hdrs = ["src/string/memmove.h"],
4496 deps = [
4497 ":__support_common",
4498 ":__support_macros_null_check",
4499 ":string_memory_utils",
4500 ],
4501 )
4502
4503 libc_function(
4504 name = "mempcpy",
4505 srcs = ["src/string/mempcpy.cpp"],
4506 hdrs = ["src/string/mempcpy.h"],
4507 deps = [
4508 ":__support_common",
4509 ":__support_macros_null_check",
4510 ":string_memory_utils",
4511 ],
4512 )
4513
4514 libc_function(
4515 name = "bcopy",
4516 srcs = ["src/strings/bcopy.cpp"],
4517 hdrs = ["src/strings/bcopy.h"],
4518 deps = [
4519 ":__support_common",
4520 ":string_memory_utils",
4521 ],
4522 )
4523
4524 libc_function(
4525 name = "memcmp",
4526 srcs = ["src/string/memcmp.cpp"],
4527 hdrs = ["src/string/memcmp.h"],
4528 deps = [
4529 ":__support_common",
4530 ":__support_integer_operations",
4531 ":__support_macros_null_check",
4532 ":string_memory_utils",
4533 ],
4534 )
4535
4536 libc_function(
4537 name = "bcmp",
4538 srcs = ["src/strings/bcmp.cpp"],
4539 hdrs = ["src/strings/bcmp.h"],
4540 deps = [
4541 ":__support_common",
4542 ":string_memory_utils",
4543 ],
4544 )
4545
4546 libc_function(
4547 name = "bzero",
4548 srcs = ["src/strings/bzero.cpp"],
4549 hdrs = ["src/strings/bzero.h"],
4550 deps = [
4551 ":__support_common",
4552 ":string_memory_utils",
4553 ],
4554 )
4555
4556 libc_function(
4557 name = "memrchr",
4558 srcs = ["src/string/memrchr.cpp"],
4559 hdrs = ["src/string/memrchr.h"],
4560 deps = [
4561 ":__support_common",
4562 ":__support_macros_null_check",
4563 ":string_utils",
4564 ],
4565 )
4566
4567 libc_function(
4568 name = "strlen",
4569 srcs = ["src/string/strlen.cpp"],
4570 hdrs = ["src/string/strlen.h"],
4571 deps = [
4572 ":__support_common",
4573 ":__support_macros_null_check",
4574 ":string_utils",
4575 ],
4576 )
4577
4578 libc_function(
4579 name = "strcpy",
4580 srcs = ["src/string/strcpy.cpp"],
4581 hdrs = ["src/string/strcpy.h"],
4582 deps = [
4583 ":__support_common",
4584 ":__support_macros_null_check",
4585 ":string_memory_utils",
4586 ":string_utils",
4587 ],
4588 )
4589
4590 libc_function(
4591 name = "strncpy",
4592 srcs = ["src/string/strncpy.cpp"],
4593 hdrs = ["src/string/strncpy.h"],
4594 deps = [
4595 ":__support_common",
4596 ":__support_macros_null_check",
4597 ],
4598 )
4599
4600 libc_function(
4601 name = "strcmp",
4602 srcs = ["src/string/strcmp.cpp"],
4603 hdrs = ["src/string/strcmp.h"],
4604 deps = [
4605 ":__support_common",
4606 ":string_memory_utils",
4607 ":string_utils",
4608 ],
4609 )
4610
4611 libc_function(
4612 name = "strchr",
4613 srcs = ["src/string/strchr.cpp"],
4614 hdrs = ["src/string/strchr.h"],
4615 deps = [
4616 ":__support_common",
4617 ":string_utils",
4618 ],
4619 )
4620
4621 libc_function(
4622 name = "strrchr",
4623 srcs = ["src/string/strrchr.cpp"],
4624 hdrs = ["src/string/strrchr.h"],
4625 deps = [
4626 ":__support_common",
4627 ":string_utils",
4628 ],
4629 )
4630
4631 libc_function(
4632 name = "strstr",
4633 srcs = ["src/string/strstr.cpp"],
4634 hdrs = ["src/string/strstr.h"],
4635 deps = [
4636 ":__support_common",
4637 ":__support_macros_null_check",
4638 ":string_memory_utils",
4639 ":string_utils",
4640 ],
4641 )
4642
4643 libc_function(
4644 name = "strnlen",
4645 srcs = ["src/string/strnlen.cpp"],
4646 hdrs = ["src/string/strnlen.h"],
4647 deps = [
4648 ":__support_common",
4649 ":string_utils",
4650 ],
4651 )
4652
4653 libc_function(
4654 name = "strcspn",
4655 srcs = ["src/string/strcspn.cpp"],
4656 hdrs = ["src/string/strcspn.h"],
4657 deps = [
4658 ":__support_common",
4659 ":string_utils",
4660 ],
4661 )
4662
4663 libc_function(
4664 name = "strspn",
4665 srcs = ["src/string/strspn.cpp"],
4666 hdrs = ["src/string/strspn.h"],
4667 deps = [
4668 ":__support_common",
4669 ":__support_cpp_bitset",
4670 ":__support_macros_null_check",
4671 ":string_utils",
4672 ],
4673 )
4674
4675 libc_function(
4676 name = "strpbrk",
4677 srcs = ["src/string/strpbrk.cpp"],
4678 hdrs = ["src/string/strpbrk.h"],
4679 deps = [
4680 ":__support_common",
4681 ":string_utils",
4682 ],
4683 )
4684
4685 libc_function(
4686 name = "strtok",
4687 srcs = ["src/string/strtok.cpp"],
4688 hdrs = ["src/string/strtok.h"],
4689 deps = [
4690 ":__support_common",
4691 ":string_utils",
4692 ],
4693 )
4694
4695 ################################ fcntl targets #################################
4696
4697 libc_function(
4698 name = "open",
4699 srcs = ["src/fcntl/linux/open.cpp"],
4700 hdrs = ["src/fcntl/open.h"],
4701 target_compatible_with = select({
4702 "@platforms//os:linux": [],
4703 "//conditions:default": ["@platforms//:incompatible"],
4704 }),
4705 deps = [
4706 ":__support_common",
4707 ":__support_osutil_fcntl",
4708 ":errno",
4709 ":hdr_fcntl_macros",
4710 ":types_mode_t",
4711 ],
4712 )
4713
4714 libc_function(
4715 name = "fcntl",
4716 srcs = ["src/fcntl/linux/fcntl.cpp"],
4717 hdrs = ["src/fcntl/fcntl.h"],
4718 target_compatible_with = select({
4719 "@platforms//os:linux": [],
4720 "//conditions:default": ["@platforms//:incompatible"],
4721 }),
4722 deps = [
4723 ":__support_common",
4724 ":__support_osutil_fcntl",
4725 ":errno",
4726 ],
4727 )
4728
4729 libc_function(
4730 name = "openat",
4731 srcs = ["src/fcntl/linux/openat.cpp"],
4732 hdrs = ["src/fcntl/openat.h"],
4733 target_compatible_with = select({
4734 "@platforms//os:linux": [],
4735 "//conditions:default": ["@platforms//:incompatible"],
4736 }),
4737 deps = [
4738 ":__support_common",
4739 ":__support_osutil_syscall",
4740 ":errno",
4741 ":hdr_fcntl_macros",
4742 ":types_mode_t",
4743 ],
4744 )
4745
4746 libc_function(
4747 name = "creat",
4748 srcs = ["src/fcntl/linux/creat.cpp"],
4749 hdrs = ["src/fcntl/creat.h"],
4750 deps = [
4751 ":__support_common",
4752 ":__support_osutil_syscall",
4753 ":errno",
4754 ":hdr_fcntl_macros",
4755 ],
4756 )
4757
4758 ################################ unistd targets ################################
4759
4760 libc_function(
4761 name = "access",
4762 srcs = ["src/unistd/linux/access.cpp"],
4763 hdrs = ["src/unistd/access.h"],
4764 deps = [
4765 ":__support_common",
4766 ":__support_osutil_syscall",
4767 ":errno",
4768 ":hdr_fcntl_macros",
4769 ],
4770 )
4771
4772 libc_function(
4773 name = "chdir",
4774 srcs = ["src/unistd/linux/chdir.cpp"],
4775 hdrs = ["src/unistd/chdir.h"],
4776 deps = [
4777 ":__support_common",
4778 ":__support_osutil_syscall",
4779 ":errno",
4780 ],
4781 )
4782
4783 libc_function(
4784 name = "close",
4785 srcs = ["src/unistd/linux/close.cpp"],
4786 hdrs = ["src/unistd/close.h"],
4787 deps = [
4788 ":__support_common",
4789 ":__support_osutil_fcntl",
4790 ":errno",
4791 ],
4792 )
4793
4794 libc_function(
4795 name = "dup",
4796 srcs = ["src/unistd/linux/dup.cpp"],
4797 hdrs = ["src/unistd/dup.h"],
4798 deps = [
4799 ":__support_common",
4800 ":__support_osutil_syscall",
4801 ":errno",
4802 ":hdr_unistd_macros",
4803 ],
4804 )
4805
4806 libc_function(
4807 name = "dup2",
4808 srcs = ["src/unistd/linux/dup2.cpp"],
4809 hdrs = ["src/unistd/dup2.h"],
4810 deps = [
4811 ":__support_common",
4812 ":__support_osutil_syscall",
4813 ":errno",
4814 ":hdr_fcntl_macros",
4815 ":hdr_unistd_macros",
4816 ],
4817 )
4818
4819 libc_function(
4820 name = "dup3",
4821 srcs = ["src/unistd/linux/dup3.cpp"],
4822 hdrs = ["src/unistd/dup3.h"],
4823 target_compatible_with = select({
4824 "@platforms//os:linux": [],
4825 "//conditions:default": ["@platforms//:incompatible"],
4826 }),
4827 deps = [
4828 ":__support_common",
4829 ":__support_osutil_syscall",
4830 ":errno",
4831 ":hdr_unistd_macros",
4832 ],
4833 )
4834
4835 libc_function(
4836 name = "environ",
4837 srcs = ["src/unistd/environ.cpp"],
4838 hdrs = ["src/unistd/environ.h"],
4839 deps = [
4840 ":__support_common",
4841 ":__support_osutil_syscall",
4842 ":errno",
4843 ],
4844 )
4845
4846 libc_function(
4847 name = "fchdir",
4848 srcs = ["src/unistd/linux/fchdir.cpp"],
4849 hdrs = ["src/unistd/fchdir.h"],
4850 deps = [
4851 ":__support_common",
4852 ":__support_osutil_syscall",
4853 ":errno",
4854 ],
4855 )
4856
4857 libc_function(
4858 name = "fsync",
4859 srcs = ["src/unistd/linux/fsync.cpp"],
4860 hdrs = ["src/unistd/fsync.h"],
4861 deps = [
4862 ":__support_common",
4863 ":__support_osutil_syscall",
4864 ":errno",
4865 ],
4866 )
4867
4868 libc_function(
4869 name = "ftruncate",
4870 srcs = ["src/unistd/linux/ftruncate.cpp"],
4871 hdrs = ["src/unistd/ftruncate.h"],
4872 deps = [
4873 ":__support_common",
4874 ":__support_osutil_syscall",
4875 ":errno",
4876 ":hdr_unistd_macros",
4877 ":types_off_t",
4878 ],
4879 )
4880
4881 # libc_function(
4882 # name = "getcwd",
4883 # srcs = ["src/unistd/linux/getcwd.cpp"],
4884 # hdrs = ["src/unistd/getcwd.h"],
4885 # deps = [
4886 # ":__support_common",
4887 # ":__support_osutil_syscall",
4888 # ":errno",
4889 # ":hdr_unistd_macros",
4890 # ":types_size_t",
4891 # ],
4892 # )
4893
4894 libc_function(
4895 name = "geteuid",
4896 srcs = ["src/unistd/linux/geteuid.cpp"],
4897 hdrs = ["src/unistd/geteuid.h"],
4898 deps = [
4899 ":__support_common",
4900 ":__support_osutil_syscall",
4901 ":errno",
4902 ":hdr_unistd_macros",
4903 ":types_size_t",
4904 ":types_uid_t",
4905 ],
4906 )
4907
4908 libc_function(
4909 name = "getppid",
4910 srcs = ["src/unistd/linux/getppid.cpp"],
4911 hdrs = ["src/unistd/getppid.h"],
4912 deps = [
4913 ":__support_common",
4914 ":__support_osutil_syscall",
4915 ":errno",
4916 ":hdr_unistd_macros",
4917 ":types_pid_t",
4918 ],
4919 )
4920
4921 libc_function(
4922 name = "getuid",
4923 srcs = ["src/unistd/linux/getuid.cpp"],
4924 hdrs = ["src/unistd/getuid.h"],
4925 deps = [
4926 ":__support_common",
4927 ":__support_osutil_syscall",
4928 ":errno",
4929 ":hdr_unistd_macros",
4930 ":types_uid_t",
4931 ],
4932 )
4933
4934 # libc_function(
4935 # name = "getopt",
4936 # srcs = ["src/unistd/getopt.cpp"],
4937 # hdrs = ["src/unistd/getopt.h"],
4938 # deps = [
4939 # ":__support_common",
4940 # ":__support_cpp_optional",
4941 # ":__support_cpp_string_view",
4942 # ":__support_file_file",
4943 # ":__support_osutil_syscall",
4944 # ":errno",
4945 # ":hdr_unistd_macros",
4946 # ],
4947 # )
4948
4949 libc_function(
4950 name = "isatty",
4951 srcs = ["src/unistd/linux/isatty.cpp"],
4952 hdrs = ["src/unistd/isatty.h"],
4953 deps = [
4954 ":__support_common",
4955 ":__support_osutil_syscall",
4956 ":errno",
4957 ":hdr_unistd_macros",
4958 ],
4959 )
4960
4961 libc_function(
4962 name = "link",
4963 srcs = ["src/unistd/linux/link.cpp"],
4964 hdrs = ["src/unistd/link.h"],
4965 deps = [
4966 ":__support_common",
4967 ":__support_osutil_syscall",
4968 ":errno",
4969 ":hdr_fcntl_macros",
4970 ":hdr_unistd_macros",
4971 ],
4972 )
4973
4974 libc_function(
4975 name = "linkat",
4976 srcs = ["src/unistd/linux/linkat.cpp"],
4977 hdrs = ["src/unistd/linkat.h"],
4978 deps = [
4979 ":__support_common",
4980 ":__support_osutil_syscall",
4981 ":errno",
4982 ":hdr_fcntl_macros",
4983 ":hdr_unistd_macros",
4984 ],
4985 )
4986
4987 libc_function(
4988 name = "pipe",
4989 srcs = ["src/unistd/linux/pipe.cpp"],
4990 hdrs = ["src/unistd/pipe.h"],
4991 deps = [
4992 ":__support_common",
4993 ":__support_macros_sanitizer",
4994 ":__support_osutil_syscall",
4995 ":errno",
4996 ],
4997 )
4998
4999 libc_function(
5000 name = "lseek",
5001 srcs = ["src/unistd/linux/lseek.cpp"],
5002 hdrs = ["src/unistd/lseek.h"],
5003 deps = [
5004 ":__support_common",
5005 ":__support_file_linux_lseekimpl",
5006 ":__support_osutil_syscall",
5007 ":errno",
5008 ":hdr_unistd_macros",
5009 ":types_off_t",
5010 ],
5011 )
5012
5013 libc_function(
5014 name = "pread",
5015 srcs = ["src/unistd/linux/pread.cpp"],
5016 hdrs = ["src/unistd/pread.h"],
5017 target_compatible_with = select({
5018 "@platforms//os:linux": [],
5019 "//conditions:default": ["@platforms//:incompatible"],
5020 }),
5021 deps = [
5022 ":__support_common",
5023 ":__support_macros_sanitizer",
5024 ":__support_osutil_syscall",
5025 ":errno",
5026 ":hdr_unistd_macros",
5027 ":types_off_t",
5028 ":types_size_t",
5029 ":types_ssize_t",
5030 ],
5031 )
5032
5033 libc_function(
5034 name = "pwrite",
5035 srcs = ["src/unistd/linux/pwrite.cpp"],
5036 hdrs = ["src/unistd/pwrite.h"],
5037 target_compatible_with = select({
5038 "@platforms//os:linux": [],
5039 "//conditions:default": ["@platforms//:incompatible"],
5040 }),
5041 deps = [
5042 ":__support_common",
5043 ":__support_osutil_syscall",
5044 ":errno",
5045 ":hdr_unistd_macros",
5046 ":types_off_t",
5047 ":types_size_t",
5048 ":types_ssize_t",
5049 ],
5050 )
5051
5052 libc_function(
5053 name = "read",
5054 srcs = ["src/unistd/linux/read.cpp"],
5055 hdrs = ["src/unistd/read.h"],
5056 deps = [
5057 ":__support_common",
5058 ":__support_macros_sanitizer",
5059 ":__support_osutil_syscall",
5060 ":errno",
5061 ":hdr_unistd_macros",
5062 ":types_size_t",
5063 ":types_ssize_t",
5064 ],
5065 )
5066
5067 libc_function(
5068 name = "readlink",
5069 srcs = ["src/unistd/linux/readlink.cpp"],
5070 hdrs = ["src/unistd/readlink.h"],
5071 deps = [
5072 ":__support_common",
5073 ":__support_osutil_syscall",
5074 ":errno",
5075 ":hdr_fcntl_macros",
5076 ":hdr_unistd_macros",
5077 ":types_size_t",
5078 ":types_ssize_t",
5079 ],
5080 )
5081
5082 libc_function(
5083 name = "readlinkat",
5084 srcs = ["src/unistd/linux/readlinkat.cpp"],
5085 hdrs = ["src/unistd/readlinkat.h"],
5086 deps = [
5087 ":__support_common",
5088 ":__support_osutil_syscall",
5089 ":errno",
5090 ":hdr_fcntl_macros",
5091 ":hdr_unistd_macros",
5092 ":types_size_t",
5093 ":types_ssize_t",
5094 ],
5095 )
5096
5097 libc_function(
5098 name = "rmdir",
5099 srcs = ["src/unistd/linux/rmdir.cpp"],
5100 hdrs = ["src/unistd/rmdir.h"],
5101 deps = [
5102 ":__support_common",
5103 ":__support_osutil_syscall",
5104 ":errno",
5105 ":hdr_fcntl_macros",
5106 ],
5107 )
5108
5109 libc_function(
5110 name = "symlink",
5111 srcs = ["src/unistd/linux/symlink.cpp"],
5112 hdrs = ["src/unistd/symlink.h"],
5113 deps = [
5114 ":__support_common",
5115 ":__support_osutil_syscall",
5116 ":errno",
5117 ":hdr_fcntl_macros",
5118 ":hdr_unistd_macros",
5119 ],
5120 )
5121
5122 libc_function(
5123 name = "symlinkat",
5124 srcs = ["src/unistd/linux/symlinkat.cpp"],
5125 hdrs = ["src/unistd/symlinkat.h"],
5126 deps = [
5127 ":__support_common",
5128 ":__support_osutil_syscall",
5129 ":errno",
5130 ":hdr_fcntl_macros",
5131 ":hdr_unistd_macros",
5132 ],
5133 )
5134
5135 #TODO: Enable once fullbuild is added to bazel, since this depends on a macro
5136 # definition in the public header
5137
5138 # libc_function(
5139 # name = "syscall",
5140 # srcs = ["src/unistd/linux/syscall.cpp"],
5141 # hdrs = ["src/unistd/syscall.h"],
5142 # deps = [
5143 # ":__support_common",
5144 # ":__support_osutil_syscall",
5145 # ":errno",
5146 # ":hdr_unistd_macros",
5147 # ],
5148 # )
5149
5150 libc_function(
5151 name = "swab",
5152 srcs = ["src/unistd/swab.cpp"],
5153 hdrs = ["src/unistd/swab.h"],
5154 deps = [
5155 ":__support_common",
5156 ":__support_osutil_syscall",
5157 ":errno",
5158 ":hdr_unistd_macros",
5159 ":types_ssize_t",
5160 ],
5161 )
5162
5163 libc_function(
5164 name = "truncate",
5165 srcs = ["src/unistd/linux/truncate.cpp"],
5166 hdrs = ["src/unistd/truncate.h"],
5167 deps = [
5168 ":__support_common",
5169 ":__support_osutil_syscall",
5170 ":errno",
5171 ":hdr_unistd_macros",
5172 ":types_off_t",
5173 ],
5174 )
5175
5176 libc_function(
5177 name = "unlink",
5178 srcs = ["src/unistd/linux/unlink.cpp"],
5179 hdrs = ["src/unistd/unlink.h"],
5180 deps = [
5181 ":__support_common",
5182 ":__support_osutil_syscall",
5183 ":errno",
5184 ":hdr_fcntl_macros",
5185 ],
5186 )
5187
5188 libc_function(
5189 name = "unlinkat",
5190 srcs = ["src/unistd/linux/unlinkat.cpp"],
5191 hdrs = ["src/unistd/unlinkat.h"],
5192 deps = [
5193 ":__support_common",
5194 ":__support_osutil_syscall",
5195 ":errno",
5196 ":hdr_fcntl_macros",
5197 ],
5198 )
5199
5200 libc_function(
5201 name = "write",
5202 srcs = ["src/unistd/linux/write.cpp"],
5203 hdrs = ["src/unistd/write.h"],
5204 deps = [
5205 ":__support_common",
5206 ":__support_osutil_syscall",
5207 ":errno",
5208 ":hdr_unistd_macros",
5209 ":types_size_t",
5210 ":types_ssize_t",
5211 ],
5212 )
5213
5214 ################################ stdio targets #################################
5215
5216 libc_support_library(
5217 name = "printf_config",
5218 hdrs = ["src/stdio/printf_core/printf_config.h"],
5219 deps = [
5220 ],
5221 )
5222
5223 libc_support_library(
5224 name = "printf_core_structs",
5225 hdrs = ["src/stdio/printf_core/core_structs.h"],
5226 deps = [
5227 ":__support_cpp_string_view",
5228 ":__support_fputil_fp_bits",
5229 ":printf_config",
5230 ],
5231 )
5232
5233 libc_support_library(
5234 name = "printf_parser",
5235 hdrs = ["src/stdio/printf_core/parser.h"],
5236 deps = [
5237 ":__support_arg_list",
5238 ":__support_common",
5239 ":__support_cpp_algorithm",
5240 ":__support_cpp_bit",
5241 ":__support_cpp_optional",
5242 ":__support_cpp_string_view",
5243 ":__support_cpp_type_traits",
5244 ":__support_ctype_utils",
5245 ":__support_fputil_fp_bits",
5246 ":__support_str_to_integer",
5247 ":errno",
5248 ":printf_config",
5249 ":printf_core_structs",
5250 ],
5251 )
5252
5253 libc_support_library(
5254 name = "printf_writer",
5255 hdrs = ["src/stdio/printf_core/writer.h"],
5256 deps = [
5257 ":__support_cpp_string_view",
5258 ":__support_macros_optimization",
5259 ":printf_core_structs",
5260 ":string_memory_utils",
5261 ],
5262 )
5263
5264 libc_support_library(
5265 name = "printf_converter",
5266 hdrs = [
5267 "src/stdio/printf_core/char_converter.h",
5268 "src/stdio/printf_core/converter.h",
5269 "src/stdio/printf_core/converter_atlas.h",
5270 "src/stdio/printf_core/converter_utils.h",
5271 "src/stdio/printf_core/float_dec_converter.h",
5272 "src/stdio/printf_core/float_hex_converter.h",
5273 "src/stdio/printf_core/float_inf_nan_converter.h",
5274 "src/stdio/printf_core/int_converter.h",
5275 "src/stdio/printf_core/ptr_converter.h",
5276 "src/stdio/printf_core/strerror_converter.h",
5277 "src/stdio/printf_core/string_converter.h",
5278 "src/stdio/printf_core/write_int_converter.h",
5279 ],
5280 deps = [
5281 ":__support_big_int",
5282 ":__support_common",
5283 ":__support_cpp_limits",
5284 ":__support_cpp_span",
5285 ":__support_cpp_string_view",
5286 ":__support_ctype_utils",
5287 ":__support_float_to_string",
5288 ":__support_fputil_fenv_impl",
5289 ":__support_fputil_fp_bits",
5290 ":__support_fputil_rounding_mode",
5291 ":__support_integer_to_string",
5292 ":__support_libc_assert",
5293 ":__support_stringutil",
5294 ":__support_uint128",
5295 ":printf_config",
5296 ":printf_core_structs",
5297 ":printf_writer",
5298 ],
5299 )
5300
5301 libc_support_library(
5302 name = "printf_main",
5303 hdrs = ["src/stdio/printf_core/printf_main.h"],
5304 deps = [
5305 ":__support_arg_list",
5306 ":printf_converter",
5307 ":printf_core_structs",
5308 ":printf_parser",
5309 ":printf_writer",
5310 ],
5311 )
5312
5313 libc_support_library(
5314 name = "vfprintf_internal",
5315 hdrs = ["src/stdio/printf_core/vfprintf_internal.h"],
5316 deps = [
5317 ":__support_arg_list",
5318 ":__support_file_file",
5319 ":__support_macros_attributes",
5320 ":printf_main",
5321 ":printf_writer",
5322 ":types_FILE",
5323 ],
5324 )
5325
5326 libc_function(
5327 name = "sprintf",
5328 srcs = ["src/stdio/sprintf.cpp"],
5329 hdrs = ["src/stdio/sprintf.h"],
5330 deps = [
5331 ":__support_arg_list",
5332 ":__support_cpp_limits",
5333 ":errno",
5334 ":printf_main",
5335 ":printf_writer",
5336 ],
5337 )
5338
5339 libc_function(
5340 name = "snprintf",
5341 srcs = ["src/stdio/snprintf.cpp"],
5342 hdrs = ["src/stdio/snprintf.h"],
5343 deps = [
5344 ":__support_arg_list",
5345 ":errno",
5346 ":printf_main",
5347 ":printf_writer",
5348 ],
5349 )
5350
5351 libc_function(
5352 name = "printf",
5353 srcs = ["src/stdio/generic/printf.cpp"],
5354 hdrs = ["src/stdio/printf.h"],
5355 deps = [
5356 ":__support_arg_list",
5357 ":__support_file_file",
5358 ":errno",
5359 ":types_FILE",
5360 ":vfprintf_internal",
5361 ],
5362 )
5363
5364 libc_function(
5365 name = "fprintf",
5366 srcs = ["src/stdio/generic/fprintf.cpp"],
5367 hdrs = ["src/stdio/fprintf.h"],
5368 deps = [
5369 ":__support_arg_list",
5370 ":__support_file_file",
5371 ":errno",
5372 ":types_FILE",
5373 ":vfprintf_internal",
5374 ],
5375 )
5376
5377 libc_function(
5378 name = "vsprintf",
5379 srcs = ["src/stdio/vsprintf.cpp"],
5380 hdrs = ["src/stdio/vsprintf.h"],
5381 deps = [
5382 ":__support_arg_list",
5383 ":__support_cpp_limits",
5384 ":errno",
5385 ":printf_main",
5386 ":printf_writer",
5387 ],
5388 )
5389
5390 libc_function(
5391 name = "vsnprintf",
5392 srcs = ["src/stdio/vsnprintf.cpp"],
5393 hdrs = ["src/stdio/vsnprintf.h"],
5394 deps = [
5395 ":__support_arg_list",
5396 ":errno",
5397 ":printf_main",
5398 ":printf_writer",
5399 ],
5400 )
5401
5402 libc_function(
5403 name = "vprintf",
5404 srcs = ["src/stdio/generic/vprintf.cpp"],
5405 hdrs = ["src/stdio/vprintf.h"],
5406 deps = [
5407 ":__support_arg_list",
5408 ":__support_file_file",
5409 ":errno",
5410 ":types_FILE",
5411 ":vfprintf_internal",
5412 ],
5413 )
5414
5415 libc_function(
5416 name = "vfprintf",
5417 srcs = ["src/stdio/generic/vfprintf.cpp"],
5418 hdrs = ["src/stdio/vfprintf.h"],
5419 deps = [
5420 ":__support_arg_list",
5421 ":__support_file_file",
5422 ":errno",
5423 ":types_FILE",
5424 ":vfprintf_internal",
5425 ],
5426 )
5427
5428 libc_support_library(
5429 name = "scanf_config",
5430 hdrs = ["src/stdio/scanf_core/scanf_config.h"],
5431 )
5432
5433 libc_support_library(
5434 name = "scanf_core_structs",
5435 hdrs = ["src/stdio/scanf_core/core_structs.h"],
5436 deps = [
5437 ":__support_cpp_bitset",
5438 ":__support_cpp_string_view",
5439 ":__support_fputil_fp_bits",
5440 ":scanf_config",
5441 ],
5442 )
5443
5444 libc_support_library(
5445 name = "scanf_parser",
5446 hdrs = ["src/stdio/scanf_core/parser.h"],
5447 deps = [
5448 ":__support_arg_list",
5449 ":__support_cpp_bitset",
5450 ":__support_ctype_utils",
5451 ":__support_str_to_integer",
5452 ":scanf_config",
5453 ":scanf_core_structs",
5454 ],
5455 )
5456
5457 libc_support_library(
5458 name = "scanf_reader",
5459 hdrs = ["src/stdio/scanf_core/reader.h"],
5460 deps = [
5461 ":__support_cpp_string_view",
5462 ":__support_macros_attributes",
5463 ":types_FILE",
5464 ],
5465 )
5466
5467 libc_support_library(
5468 name = "scanf_string_reader",
5469 hdrs = ["src/stdio/scanf_core/string_reader.h"],
5470 deps = [
5471 ":__support_macros_attributes",
5472 ":scanf_reader",
5473 ],
5474 )
5475
5476 libc_support_library(
5477 name = "scanf_converter",
5478 srcs = [
5479 "src/stdio/scanf_core/converter_utils.h",
5480 "src/stdio/scanf_core/current_pos_converter.h",
5481 "src/stdio/scanf_core/float_converter.h",
5482 "src/stdio/scanf_core/int_converter.h",
5483 "src/stdio/scanf_core/ptr_converter.h",
5484 "src/stdio/scanf_core/string_converter.h",
5485 ],
5486 hdrs = [
5487 "src/stdio/scanf_core/converter.h",
5488 ],
5489 deps = [
5490 ":__support_char_vector",
5491 ":__support_cpp_bitset",
5492 ":__support_cpp_limits",
5493 ":__support_cpp_string_view",
5494 ":__support_ctype_utils",
5495 ":__support_str_to_float",
5496 ":scanf_core_structs",
5497 ":scanf_reader",
5498 ],
5499 )
5500
5501 libc_support_library(
5502 name = "scanf_main",
5503 hdrs = ["src/stdio/scanf_core/scanf_main.h"],
5504 deps = [
5505 ":__support_arg_list",
5506 ":scanf_config",
5507 ":scanf_converter",
5508 ":scanf_core_structs",
5509 ":scanf_parser",
5510 ":scanf_reader",
5511 ],
5512 )
5513
5514 libc_support_library(
5515 name = "vfscanf_internal",
5516 hdrs = ["src/stdio/scanf_core/vfscanf_internal.h"],
5517 deps = [
5518 ":__support_arg_list",
5519 ":__support_file_file",
5520 ":__support_macros_attributes",
5521 ":scanf_main",
5522 ":scanf_reader",
5523 ":types_FILE",
5524 ],
5525 )
5526
5527 libc_function(
5528 name = "scanf",
5529 srcs = ["src/stdio/generic/scanf.cpp"],
5530 hdrs = ["src/stdio/scanf.h"],
5531 deps = [
5532 ":__support_arg_list",
5533 ":__support_file_file",
5534 ":types_FILE",
5535 ":vfscanf_internal",
5536 ],
5537 )
5538
5539 libc_function(
5540 name = "vscanf",
5541 srcs = ["src/stdio/generic/vscanf.cpp"],
5542 hdrs = ["src/stdio/vscanf.h"],
5543 deps = [
5544 ":__support_arg_list",
5545 ":__support_file_file",
5546 ":types_FILE",
5547 ":vfscanf_internal",
5548 ],
5549 )
5550
5551 libc_function(
5552 name = "fscanf",
5553 srcs = ["src/stdio/generic/fscanf.cpp"],
5554 hdrs = ["src/stdio/fscanf.h"],
5555 deps = [
5556 ":__support_arg_list",
5557 ":__support_file_file",
5558 ":types_FILE",
5559 ":vfscanf_internal",
5560 ],
5561 )
5562
5563 libc_function(
5564 name = "vfscanf",
5565 srcs = ["src/stdio/generic/vfscanf.cpp"],
5566 hdrs = ["src/stdio/vfscanf.h"],
5567 deps = [
5568 ":__support_arg_list",
5569 ":__support_file_file",
5570 ":types_FILE",
5571 ":vfscanf_internal",
5572 ],
5573 )
5574
5575 libc_function(
5576 name = "sscanf",
5577 srcs = ["src/stdio/sscanf.cpp"],
5578 hdrs = ["src/stdio/sscanf.h"],
5579 deps = [
5580 ":__support_arg_list",
5581 ":__support_file_file",
5582 ":scanf_main",
5583 ":scanf_string_reader",
5584 ":types_FILE",
5585 ],
5586 )
5587
5588 libc_function(
5589 name = "vsscanf",
5590 srcs = ["src/stdio/vsscanf.cpp"],
5591 hdrs = ["src/stdio/vsscanf.h"],
5592 deps = [
5593 ":__support_arg_list",
5594 ":__support_file_file",
5595 ":scanf_main",
5596 ":scanf_string_reader",
5597 ":types_FILE",
5598 ],
5599 )
5600
5601 libc_function(
5602 name = "remove",
5603 srcs = ["src/stdio/linux/remove.cpp"],
5604 hdrs = ["src/stdio/remove.h"],
5605 deps = [
5606 ":__support_common",
5607 ":__support_osutil_syscall",
5608 ":errno",
5609 ":hdr_fcntl_macros",
5610 ":hdr_stdio_overlay",
5611 ":types_FILE",
5612 ],
5613 )
5614
5615 libc_function(
5616 name = "rename",
5617 srcs = ["src/stdio/linux/rename.cpp"],
5618 hdrs = ["src/stdio/rename.h"],
5619 target_compatible_with = select({
5620 "@platforms//os:linux": [],
5621 "//conditions:default": ["@platforms//:incompatible"],
5622 }),
5623 deps = [
5624 ":__support_common",
5625 ":__support_osutil_syscall",
5626 ":errno",
5627 ":hdr_fcntl_macros",
5628 ":llvm_libc_macros_fcntl_macros",
5629 ],
5630 )
5631
5632 ############################### sys/stat targets ###############################
5633
5634 libc_function(
5635 name = "mkdir",
5636 srcs = ["src/sys/stat/linux/mkdir.cpp"],
5637 hdrs = ["src/sys/stat/mkdir.h"],
5638 deps = [
5639 ":__support_common",
5640 ":__support_osutil_syscall",
5641 ":errno",
5642 ":hdr_fcntl_macros",
5643 ":types_mode_t",
5644 ],
5645 )
5646
5647 libc_function(
5648 name = "mkdirat",
5649 srcs = ["src/sys/stat/linux/mkdirat.cpp"],
5650 hdrs = ["src/sys/stat/mkdirat.h"],
5651 deps = [
5652 ":__support_common",
5653 ":__support_osutil_syscall",
5654 ":errno",
5655 ],
5656 )
5657
5658 ############################## sys/socket targets ##############################
5659
5660 libc_function(
5661 name = "socket",
5662 srcs = ["src/sys/socket/linux/socket.cpp"],
5663 hdrs = ["src/sys/socket/socket.h"],
5664 deps = [
5665 ":__support_common",
5666 ":__support_osutil_syscall",
5667 ":errno",
5668 ],
5669 )
5670
5671 libc_function(
5672 name = "socketpair",
5673 srcs = ["src/sys/socket/linux/socketpair.cpp"],
5674 hdrs = ["src/sys/socket/socketpair.h"],
5675 deps = [
5676 ":__support_common",
5677 ":__support_osutil_syscall",
5678 ":errno",
5679 ],
5680 )
5681
5682 libc_function(
5683 name = "send",
5684 srcs = ["src/sys/socket/linux/send.cpp"],
5685 hdrs = ["src/sys/socket/send.h"],
5686 deps = [
5687 ":__support_common",
5688 ":__support_osutil_syscall",
5689 ":errno",
5690 ":types_socklen_t",
5691 ":types_ssize_t",
5692 ":types_struct_sockaddr",
5693 ],
5694 )
5695
5696 libc_function(
5697 name = "sendto",
5698 srcs = ["src/sys/socket/linux/sendto.cpp"],
5699 hdrs = ["src/sys/socket/sendto.h"],
5700 deps = [
5701 ":__support_common",
5702 ":__support_osutil_syscall",
5703 ":errno",
5704 ":types_socklen_t",
5705 ":types_ssize_t",
5706 ":types_struct_sockaddr",
5707 ],
5708 )
5709
5710 libc_function(
5711 name = "sendmsg",
5712 srcs = ["src/sys/socket/linux/sendmsg.cpp"],
5713 hdrs = ["src/sys/socket/sendmsg.h"],
5714 deps = [
5715 ":__support_common",
5716 ":__support_osutil_syscall",
5717 ":errno",
5718 ":types_ssize_t",
5719 ":types_struct_msghdr",
5720 ],
5721 )
5722
5723 libc_function(
5724 name = "recv",
5725 srcs = ["src/sys/socket/linux/recv.cpp"],
5726 hdrs = ["src/sys/socket/recv.h"],
5727 deps = [
5728 ":__support_common",
5729 ":__support_osutil_syscall",
5730 ":errno",
5731 ":types_socklen_t",
5732 ":types_ssize_t",
5733 ":types_struct_sockaddr",
5734 ],
5735 )
5736
5737 libc_function(
5738 name = "recvfrom",
5739 srcs = ["src/sys/socket/linux/recvfrom.cpp"],
5740 hdrs = ["src/sys/socket/recvfrom.h"],
5741 deps = [
5742 ":__support_common",
5743 ":__support_osutil_syscall",
5744 ":errno",
5745 ":types_socklen_t",
5746 ":types_ssize_t",
5747 ":types_struct_sockaddr",
5748 ],
5749 )
5750
5751 libc_function(
5752 name = "recvmsg",
5753 srcs = ["src/sys/socket/linux/recvmsg.cpp"],
5754 hdrs = ["src/sys/socket/recvmsg.h"],
5755 deps = [
5756 ":__support_common",
5757 ":__support_osutil_syscall",
5758 ":errno",
5759 ":types_ssize_t",
5760 ":types_struct_msghdr",
5761 ],
5762 )
5763
5764 ############################## sys/epoll targets ###############################
5765
5766 libc_function(
5767 name = "epoll_create",
5768 srcs = ["src/sys/epoll/linux/epoll_create.cpp"],
5769 hdrs = ["src/sys/epoll/epoll_create.h"],
5770 target_compatible_with = select({
5771 "@platforms//os:linux": [],
5772 "//conditions:default": ["@platforms//:incompatible"],
5773 }),
5774 deps = [
5775 ":__support_osutil_syscall",
5776 ":errno",
5777 ],
5778 )
5779
5780 libc_function(
5781 name = "epoll_create1",
5782 srcs = ["src/sys/epoll/linux/epoll_create1.cpp"],
5783 hdrs = ["src/sys/epoll/epoll_create1.h"],
5784 target_compatible_with = select({
5785 "@platforms//os:linux": [],
5786 "//conditions:default": ["@platforms//:incompatible"],
5787 }),
5788 deps = [
5789 ":__support_osutil_syscall",
5790 ":errno",
5791 ],
5792 )
5793
5794 libc_function(
5795 name = "epoll_ctl",
5796 srcs = ["src/sys/epoll/linux/epoll_ctl.cpp"],
5797 hdrs = ["src/sys/epoll/epoll_ctl.h"],
5798 target_compatible_with = select({
5799 "@platforms//os:linux": [],
5800 "//conditions:default": ["@platforms//:incompatible"],
5801 }),
5802 deps = [
5803 ":__support_osutil_syscall",
5804 ":errno",
5805 ":hdr_sys_epoll_macros",
5806 ":types_struct_epoll_event",
5807 ],
5808 )
5809
5810 libc_function(
5811 name = "epoll_wait",
5812 srcs = ["src/sys/epoll/linux/epoll_wait.cpp"],
5813 hdrs = ["src/sys/epoll/epoll_wait.h"],
5814 target_compatible_with = select({
5815 "@platforms//os:linux": [],
5816 "//conditions:default": ["@platforms//:incompatible"],
5817 }),
5818 deps = [
5819 ":__support_macros_sanitizer",
5820 ":__support_osutil_syscall",
5821 ":errno",
5822 ":hdr_signal_macros",
5823 ":hdr_sys_epoll_macros",
5824 ":types_sigset_t",
5825 ":types_struct_epoll_event",
5826 ],
5827 )
5828
5829 libc_function(
5830 name = "epoll_pwait",
5831 srcs = ["src/sys/epoll/linux/epoll_pwait.cpp"],
5832 hdrs = ["src/sys/epoll/epoll_pwait.h"],
5833 target_compatible_with = select({
5834 "@platforms//os:linux": [],
5835 "//conditions:default": ["@platforms//:incompatible"],
5836 }),
5837 deps = [
5838 ":__support_macros_sanitizer",
5839 ":__support_osutil_syscall",
5840 ":errno",
5841 ":hdr_signal_macros",
5842 ":hdr_sys_epoll_macros",
5843 ":types_sigset_t",
5844 ":types_struct_epoll_event",
5845 ],
5846 )
5847
5848 libc_function(
5849 name = "epoll_pwait2",
5850 srcs = ["src/sys/epoll/linux/epoll_pwait2.cpp"],
5851 hdrs = ["src/sys/epoll/epoll_pwait2.h"],
5852 target_compatible_with = select({
5853 "@platforms//os:linux": [],
5854 "//conditions:default": ["@platforms//:incompatible"],
5855 }),
5856 deps = [
5857 ":__support_macros_sanitizer",
5858 ":__support_osutil_syscall",
5859 ":errno",
5860 ":hdr_signal_macros",
5861 ":hdr_sys_epoll_macros",
5862 ":types_sigset_t",
5863 ":types_struct_epoll_event",
5864 ":types_struct_timespec",
5865 ],
5866 )
5867
5868 ############################## wchar targets ###############################
5869
5870 libc_function(
5871 name = "btowc",
5872 srcs = ["src/wchar/btowc.cpp"],
5873 hdrs = ["src/wchar/btowc.h"],
5874 deps = [
5875 ":__support_common",
5876 ":__support_macros_config",
5877 ":__support_wctype_utils",
5878 ":hdr_wchar_macros",
5879 ":types_wint_t",
5880 ],
5881 )
5882
5883 libc_function(
5884 name = "wcpcpy",
5885 srcs = ["src/wchar/wcpcpy.cpp"],
5886 hdrs = ["src/wchar/wcpcpy.h"],
5887 deps = [
5888 ":__support_common",
5889 ":__support_macros_config",
5890 ":string_utils",
5891 ":types_size_t",
5892 ":types_wchar_t",
5893 ],
5894 )
5895
5896 libc_function(
5897 name = "wcpncpy",
5898 srcs = ["src/wchar/wcpncpy.cpp"],
5899 hdrs = ["src/wchar/wcpncpy.h"],
5900 deps = [
5901 ":__support_common",
5902 ":__support_macros_config",
5903 ":__support_macros_null_check",
5904 ":types_size_t",
5905 ":types_wchar_t",
5906 ],
5907 )
5908
5909 libc_function(
5910 name = "wcscat",
5911 srcs = ["src/wchar/wcscat.cpp"],
5912 hdrs = ["src/wchar/wcscat.h"],
5913 deps = [
5914 ":__support_common",
5915 ":__support_macros_config",
5916 ":string_utils",
5917 ":types_size_t",
5918 ":types_wchar_t",
5919 ],
5920 )
5921
5922 libc_function(
5923 name = "wcschr",
5924 srcs = ["src/wchar/wcschr.cpp"],
5925 hdrs = ["src/wchar/wcschr.h"],
5926 deps = [
5927 ":__support_common",
5928 ":__support_macros_config",
5929 ":types_wchar_t",
5930 ],
5931 )
5932
5933 libc_function(
5934 name = "wcscmp",
5935 srcs = ["src/wchar/wcscmp.cpp"],
5936 hdrs = ["src/wchar/wcscmp.h"],
5937 deps = [
5938 ":__support_common",
5939 ":__support_macros_null_check",
5940 ":types_size_t",
5941 ":types_wchar_t",
5942 ],
5943 )
5944
5945 libc_function(
5946 name = "wcscpy",
5947 srcs = ["src/wchar/wcscpy.cpp"],
5948 hdrs = ["src/wchar/wcscpy.h"],
5949 deps = [
5950 ":__support_common",
5951 ":__support_macros_config",
5952 ":string_utils",
5953 ":types_size_t",
5954 ":types_wchar_t",
5955 ],
5956 )
5957
5958 libc_function(
5959 name = "wcscspn",
5960 srcs = ["src/wchar/wcscspn.cpp"],
5961 hdrs = ["src/wchar/wcscspn.h"],
5962 deps = [
5963 ":__support_common",
5964 ":__support_macros_config",
5965 ":types_size_t",
5966 ":types_wchar_t",
5967 ],
5968 )
5969
5970 libc_function(
5971 name = "wcslcat",
5972 srcs = ["src/wchar/wcslcat.cpp"],
5973 hdrs = ["src/wchar/wcslcat.h"],
5974 deps = [
5975 ":__support_common",
5976 ":__support_macros_config",
5977 ":string_utils",
5978 ":types_size_t",
5979 ":types_wchar_t",
5980 ],
5981 )
5982
5983 libc_function(
5984 name = "wcslcpy",
5985 srcs = ["src/wchar/wcslcpy.cpp"],
5986 hdrs = ["src/wchar/wcslcpy.h"],
5987 deps = [
5988 ":__support_common",
5989 ":__support_macros_config",
5990 ":string_utils",
5991 ":types_size_t",
5992 ":types_wchar_t",
5993 ],
5994 )
5995
5996 libc_function(
5997 name = "wcslen",
5998 srcs = ["src/wchar/wcslen.cpp"],
5999 hdrs = ["src/wchar/wcslen.h"],
6000 deps = [
6001 ":__support_common",
6002 ":__support_macros_config",
6003 ":string_utils",
6004 ":types_size_t",
6005 ":types_wchar_t",
6006 ],
6007 )
6008
6009 libc_function(
6010 name = "wcsncat",
6011 srcs = ["src/wchar/wcsncat.cpp"],
6012 hdrs = ["src/wchar/wcsncat.h"],
6013 deps = [
6014 ":__support_common",
6015 ":__support_macros_config",
6016 ":string_utils",
6017 ":types_size_t",
6018 ":types_wchar_t",
6019 ],
6020 )
6021
6022 libc_function(
6023 name = "wcsncmp",
6024 srcs = ["src/wchar/wcsncmp.cpp"],
6025 hdrs = ["src/wchar/wcsncmp.h"],
6026 deps = [
6027 ":__support_common",
6028 ":__support_macros_null_check",
6029 ":types_size_t",
6030 ":types_wchar_t",
6031 ],
6032 )
6033
6034 libc_function(
6035 name = "wcsncpy",
6036 srcs = ["src/wchar/wcsncpy.cpp"],
6037 hdrs = ["src/wchar/wcsncpy.h"],
6038 deps = [
6039 ":__support_common",
6040 ":__support_macros_config",
6041 ":types_size_t",
6042 ":types_wchar_t",
6043 ],
6044 )
6045
6046 libc_function(
6047 name = "wcspbrk",
6048 srcs = ["src/wchar/wcspbrk.cpp"],
6049 hdrs = ["src/wchar/wcspbrk.h"],
6050 deps = [
6051 ":__support_common",
6052 ":__support_macros_null_check",
6053 ":types_wchar_t",
6054 ],
6055 )
6056
6057 libc_function(
6058 name = "wcsrchr",
6059 srcs = ["src/wchar/wcsrchr.cpp"],
6060 hdrs = ["src/wchar/wcsrchr.h"],
6061 deps = [
6062 ":__support_common",
6063 ":__support_macros_config",
6064 ":__support_macros_null_check",
6065 ":types_wchar_t",
6066 ],
6067 )
6068
6069 libc_function(
6070 name = "wcsspn",
6071 srcs = ["src/wchar/wcsspn.cpp"],
6072 hdrs = ["src/wchar/wcsspn.h"],
6073 deps = [
6074 ":__support_common",
6075 ":__support_macros_config",
6076 ":types_size_t",
6077 ":types_wchar_t",
6078 ],
6079 )
6080
6081 libc_function(
6082 name = "wcsstr",
6083 srcs = ["src/wchar/wcsstr.cpp"],
6084 hdrs = ["src/wchar/wcsstr.h"],
6085 deps = [
6086 ":__support_common",
6087 ":__support_macros_config",
6088 ":string_utils",
6089 ":types_size_t",
6090 ":types_wchar_t",
6091 ],
6092 )
6093
6094 libc_function(
6095 name = "wctob",
6096 srcs = ["src/wchar/wctob.cpp"],
6097 hdrs = ["src/wchar/wctob.h"],
6098 deps = [
6099 ":__support_common",
6100 ":__support_macros_config",
6101 ":__support_macros_null_check",
6102 ":__support_wctype_utils",
6103 ":hdr_stdio_macros",
6104 ":types_wint_t",
6105 ],
6106 )
6107
6108 libc_function(
6109 name = "wmemchr",
6110 srcs = ["src/wchar/wmemchr.cpp"],
6111 hdrs = ["src/wchar/wmemchr.h"],
6112 deps = [
6113 ":__support_common",
6114 ":__support_macros_config",
6115 ":types_size_t",
6116 ":types_wchar_t",
6117 ],
6118 )
6119
6120 libc_function(
6121 name = "wmemcmp",
6122 srcs = ["src/wchar/wmemcmp.cpp"],
6123 hdrs = ["src/wchar/wmemcmp.h"],
6124 deps = [
6125 ":__support_common",
6126 ":__support_macros_config",
6127 ":__support_macros_null_check",
6128 ":types_size_t",
6129 ":types_wchar_t",
6130 ],
6131 )
6132
6133 libc_function(
6134 name = "wmemcpy",
6135 srcs = ["src/wchar/wmemcpy.cpp"],
6136 hdrs = ["src/wchar/wmemcpy.h"],
6137 deps = [
6138 ":__support_common",
6139 ":__support_macros_config",
6140 ":types_size_t",
6141 ":types_wchar_t",
6142 ],
6143 )
6144
6145 libc_function(
6146 name = "wmemmove",
6147 srcs = ["src/wchar/wmemmove.cpp"],
6148 hdrs = ["src/wchar/wmemmove.h"],
6149 deps = [
6150 ":__support_common",
6151 ":__support_macros_null_check",
6152 ":types_size_t",
6153 ":types_wchar_t",
6154 ],
6155 )
6156
6157 libc_function(
6158 name = "wmempcpy",
6159 srcs = ["src/wchar/wmempcpy.cpp"],
6160 hdrs = ["src/wchar/wmempcpy.h"],
6161 deps = [
6162 ":__support_common",
6163 ":types_size_t",
6164 ":types_wchar_t",
6165 ],
6166 )
6167
6168 libc_function(
6169 name = "wmemset",
6170 srcs = ["src/wchar/wmemset.cpp"],
6171 hdrs = ["src/wchar/wmemset.h"],
6172 deps = [
6173 ":__support_common",
6174 ":types_size_t",
6175 ":types_wchar_t",
6176 ],
6177 )