2608 Commits

Author SHA1 Message Date
Alexey Samsonov
279e82fca7
Revert f9146ccbe940d8b8eb15e7686a511a28eb0abc6b (#131656)
This reverts commit f9146ccbe940d8b8eb15e7686a511a28eb0abc6b
([libc][bazel] explicitly use system-provided errno in Bazel builds.
(#130663))

This change causes problems in Bazel builds where system errno is set to
non-zero before the tests even begin to run - see PR #131650 for the
disucssion on how to address this.
2025-03-17 11:35:42 -07:00
Benjamin Kramer
94dc397c7e [bazel] Add missing dependencies for fd24805c8e67c921991e82463bdc23563caf744e 2025-03-15 11:29:52 +01:00
Bart Chrzaszcz
e45090e5f0
Fix BUILD.bazel due to a16c225 2025-03-14 11:56:32 +00:00
Brian Ledger
4bcf1e61eb
Update the libc BUILD.bazel file with selects for Windows builds. (#131172)
The Windows toolchain needs to build libc targets in order to support
libc++. Currently, some targets fail to resolve, due to non-exhaustive
select statements, not accounting for Windows builds.

This change adds clauses to select statements so that Windows builds can
proceed.

Additionally, `__support_osutil_exit`, is configured to pass nothing to
`srcs` for non-Linux builds. `__support_osutil_exit `is unconditionally
included in the transitive dependencies of `extern_libc_shared`.

---------

Co-authored-by: Brian Ledger <brianpl@google.com>
2025-03-13 15:19:13 -05:00
Bart Chrzaszcz
b990c81502
Partial fix of BUILD.bazel after 598e882. (#131140) 2025-03-13 13:40:56 +00:00
Bart Chrzaszcz
c6e88b2189
Proper BUILD.bazel fix due to c07e1e3 (#130962) 2025-03-12 13:39:02 +00:00
Bart Chrzaszcz
0165ca3a09
BUILD.bazel fix due to c07e1e3 2025-03-12 11:44:45 +00:00
Alexey Samsonov
10a6a349d6
[libc][bazel] Create libc_release_library for release configurations. (#130694)
See PR #130327 for background and motivation. This change expands the
libc_support_library and libc_function rules to create filegroups that
allow building a collection of llvm-libc functions together, from
sources, as a part of a single cc_library that can then be used by the
downstream clients.

This change also adds an example use of this macro under
libc/test/BUILD.bazel to confirm that this macro works as expected.
2025-03-11 13:19:54 -07:00
Bart Chrzaszcz
d8d2e0779a
Even more BUILD.bazel fixes for commit 205c532. (#130784) 2025-03-11 15:36:58 +00:00
Bart Chrzaszcz
b9d6b62721
Fix [mlir] Fix bazel build after 205c532 round 2. (#130765) 2025-03-11 14:03:39 +00:00
Bart Chrzaszcz
f590843616
[mlir] Fix bazel build after 205c532 2025-03-11 10:42:49 +00:00
Jorge Gorbe Moya
5bf0486599
[libc][bazel] Remove unneeded deps. (#130696)
The MPFRWrapper BUILD targets don't depend directly on gmp. MPFR itself
does depend on gmp, but not the wrapper.
2025-03-10 20:16:02 -07:00
Alexey Samsonov
f9146ccbe9
[libc][bazel] explicitly use system-provided errno in Bazel builds. (#130663)
Addressing the comments from PR #130368 review. Since Bazel builds are
effectively overlay mode, switch to explicitly setting
-DLIBC_ERRNO_MODE=LIBC_ERRNO_MODE_SYSTEM configuration option, so that
unit tests and release builds are consistent. Verified that all the unit
tests pass with this flag specified.
2025-03-10 13:28:04 -07:00
Alexey Samsonov
9f170e6abe
[libc][bazel] Convert "errno" to libc_support_library. (#130368)
This shouldn't really be a "libc_function" since it can be used as a
dependency of various other support libraries and functions, and doesn't
correspond to a well-defined endpoint that the users may want to
explicitly depend on (if they depend on it implicitly through a
libc_function whose implementation relies on errno, the dependency will
be pulled in normally). Remove special handling for "errno" in the Bazel
test rules.

This is one more cleanup step unlocking the plan outlined in #130327
2025-03-10 12:59:02 -07:00
Bart Chrzaszcz
497a3df6bb
[mlir] Fix bazel build after f3dcc0f TD files 2025-03-10 16:34:15 +00:00
Bart Chrzaszcz
8885b5c062
[mlir] Fix bazel build after f3dcc0fe228f6a1a69147ead0a76ce0fe02d316d 2025-03-10 14:36:40 +00:00
Alexey Samsonov
76e9b2a614
[libc][bazel] Introduce libc_test_library macros. (#130355)
Use it instead of libc_support_library macros for all helper libraries
that are used for unit tests. See #130327 for the rationale why we want
to do this. With this change, we can additionally ensure that no
testonly library will end up being a dependency of production libraries.
2025-03-07 15:09:23 -08:00
Alexey Samsonov
d90423e310
[libc][bazel] Minor cleanup to remove unused dependencies. (#130348)
* strcpy doesn't need to depend on memcpy
* qsort_test_helper has been generalized and doesn't need to depend on
qsort.

This is a small cleanup to unblock the work outlined in #130327.
2025-03-07 13:31:18 -08:00
Michael Jones
3a228a33c4
[libc][bazel] Main f16 test targets, new f16 funcs (#130208)
This patch adds acosf16 and asinf16 which I missed last patch, and also
the primary math tests for the float16 functions.
2025-03-07 11:38:15 -08:00
Augie Fackler
8da48b4003 [bazel] update lldb deps for de9cee1c97882dc69a20ac688d20a84f831b62c6 2025-03-07 09:33:24 -05:00
Augie Fackler
50a0931ccd [bazel] update lldb deps for 39a4da20d88d797824f0e7be0f732ccaf0c7eee4 2025-03-07 09:25:42 -05:00
Benjamin Chetioui
308f933f75
[mlir] Fix bazel build after 95767a9903208e545badd920a1a16e5476ae09f9. (#130283) 2025-03-07 14:37:31 +01:00
Augie Fackler
995c0f7bb7 [bazel] update mlir python deps for 95767a9903208e545badd920a1a16e5476ae09f9 2025-03-07 08:13:50 -05:00
Augie Fackler
94c937d321 [bazel] fix lldb deps some more 2025-03-06 20:39:26 -05:00
Augie Fackler
7a7fe6e8ca [bazel] fix libc deps for 542d52b1e8a0a7e04538f608487603124c70e1ab 2025-03-06 20:24:38 -05:00
Michael Jones
1df59b3817
[libc][bazel] Add targets for float16 math (#129965)
Add targets for some float16 math functions that were missing them, but
mostly add targets for the smoke tests.
2025-03-06 10:46:20 -08:00
Augie Fackler
35842f354e [bazel] add missing another missing dep in mlir 2025-03-06 11:33:19 -05:00
Augie Fackler
3c74262604 [bazel] add missing deps in mlir 2025-03-06 11:13:33 -05:00
Dmitri Gribenko
0953706bfd [bazel][libc] Add missing dep after 1e6e845d49a336e9da7ca6c576ec45c0b419b5f6 2025-03-05 10:08:06 +01:00
Jorge Gorbe Moya
423862f3d5 [bazel][libc] Add missing dep after 1e6e845d49a336e9da7ca6c576ec45c0b419b5f6 2025-03-04 12:00:40 -08:00
Jorge Gorbe Moya
f9a6ea4489
[libc][bazel] Add BUILD targets for complex functions and tests. (#129618)
This involved a little bit of yak shaving because one of the new tests
depends on MPC, and we didn't have targets for it yet, so I ended up
needing to add a similar setup to what we have for MPFR.
2025-03-04 11:05:01 -08:00
Augie Fackler
fd9a882ce3 [bazel] add missing header to bolt build file 2025-03-03 16:41:14 -05:00
Augie Fackler
2cb7b4e0cd [bazel] fix missing dep on //llvm:config in //lldb:Core 2025-03-03 16:15:21 -05:00
Augie Fackler
08dc81bd29 [bazel] fixes to make Telemetry work in lldb
Previously telemetry was optional at build-time in such a way that none
of it was built at all, but llvm/llvm-project@159b872b37 changed that
and now it's optional in a different way so we need to have it available
in the bazel BUILD graph.
2025-03-03 15:06:54 -05:00
Benjamin Chetioui
4396237972
[mlir][bazel] Fix Bazel build after db0e7c72aff622849abbc92c3ed0d06efb8e2d16. (#129532)
db0e7c72aff622849abbc92c3ed0d06efb8e2d16.
2025-03-03 15:02:01 +01:00
Mikhail Goncharov
1adb00110e [bazel] port 15c49b9db3f60bdbd320271d5e97f118c00b95dd 2025-02-28 10:31:31 +01:00
Mikhail Goncharov
a278b28a94 [bazel] fix build after bafd44bff58cff9efe569a221b232bab004d55cd 2025-02-28 10:20:16 +01:00
Alexey Samsonov
bafd44bff5
[libc][bazel] Add py_binary rule to build hdrgen. (#129161) 2025-02-27 20:07:04 -08:00
Michael Jones
310c3775c0
[libc][bazel] Rephrase list comp for downstream (#129119)
The downstream build was having trouble transforming the previous list
comprehension, but it works on this one. I guess it just needs to look
like a proper target.
2025-02-27 13:13:52 -08:00
Mikhail Goncharov
9a4320adb1 [bazel] port 42526d240cc953963ea48bae0b4c2ab548e9d897
include "../" looks wrong
2025-02-27 09:25:03 +01:00
Michael Jones
524711c344
[libc][bazel] Add targets for strfrom<float> (#128956)
Add targets and tests for strfromf, strfromd and strfroml.

No idea why the standard committee decided that the long double function
should be "strfroml" instead of "strfromld" which would match "strtold"
and leave them space to add string from integer functions in future.
2025-02-26 15:30:40 -08:00
Michael Jones
579ead1a69
[libc][bazel] Add targets for stdbit functions (#128934)
Adds targets for the stdbit functions. Since the names follow a strict
pattern, this is done via list comprehensions. I don't want to handwrite
all 50.
2025-02-26 13:04:52 -08:00
Mircea Trofin
c690b3065d
[Bazel] Port 128541 (#128809) 2025-02-26 10:43:48 -08:00
Vy Nguyen
159b872b37
[llvm][telemetry]Change Telemetry-disabling mechanism. (#128534)
Details:
- Previously, we used the LLVM_BUILD_TELEMETRY flag to control whether
any Telemetry code will be built. This has proven to cause more nuisance
to both users of the Telemetry and any further extension of it. (Eg., we
needed to put #ifdef around caller/user code)

- So the new approach is to:
+ Remove this flag and introduce LLVM_ENABLE_TELEMETRY which would be
true by default.
+ If LLVM_ENABLE_TELEMETRY is set to FALSE (at buildtime), the library
would still be built BUT Telemetry cannot be enabled. And no data can be
collected.

The benefit of this is that it simplifies user (and extension) code
since we just need to put the check on Config::EnableTelemetry. Besides,
the Telemetry library itself is very small, hence the additional code to
be built would not cause any difference in build performance.

---------

Co-authored-by: Pavel Labath <pavel@labath.sk>
2025-02-26 13:01:53 -05:00
Benjamin Kramer
5c8e22bb26 [bazel] Export BuiltinTemplates.inc from clang:basic 2025-02-26 16:23:04 +01:00
Benjamin Kramer
fd08b0793f [bazel] Port 8dd8e5f7d692cc43f4322f04034f5c472381aa43 2025-02-26 16:18:02 +01:00
Mikhail Goncharov
2d12c9e83f [bazel] add missing header for RelayoutOptInterface
for a778930f85b6d17cf31ff0e15964a7c7116e2a9d
2025-02-26 11:07:33 +01:00
Sterling-Augustine
864071dd7e
Bazel fixes for a778930f85b6d17cf31ff0e15964a7c7116e2a9d (#128783) 2025-02-25 14:56:38 -08:00
Mikhail Goncharov
0f9720a61b [bazel] port 29e14958090cb01150bda068f721a09d4bb1c36b 2025-02-25 13:11:01 +01:00
Mikhail Goncharov
d7211693af [bazel] port e5ce0304335dc1cae6856c880d1d4e14dcf8265d 2025-02-25 10:13:33 +01:00