2629 Commits

Author SHA1 Message Date
Michael Jones
09ff6db0dc
[bazel] add missing dep to errno_test_helpers (#132278)
Bazel doesn't complain, but downstream it's causing build failures.
2025-03-20 14:13:12 -07:00
Benjamin Kramer
dd3addf954 [bazel] Add missing dependency for ff3341ca35fe4ce05b52e89d654ff4c696d3602e 2025-03-20 19:02:19 +01:00
Alexey Samsonov
4c36c425ec
[libc] Migrate sys/socket tests to use ErrnoCheckingTest. (#132107)
Also use ErrnoSetterMatcher to verify the function return values and
verify/clear out errno values. Fix the bug in ErrnoSetterMatcher error
reporting machinery to properly convert errno values into errno names to
make error messages easier to debug.
2025-03-19 15:33:20 -07:00
Alexey Samsonov
2f7ad891a7
[libc] Migrate unistd tests to use ErrnoCheckingTest. (#132067)
Use ErrnoCheckingTest harness added in
d039af33096c0a83b03475a240d5e281e2271c44 for all unistd tests that
verify errno values. Stop explicitly setting it to zero in test code, as
harness does it.

It also verifies that the errno is zero at the end of each test case, so
update the ASSERT_ERRNO_EQ and ASSERT_ERRNO_FAILURE macro to clear out
its value after the verification (similar to how ErrnoSetterMatcher
does).

Update the CMake and Bazel rules for those tests. In the latter case,
remove commented out tests that are currently unsupported in Bazel,
since they get stale quickly.
2025-03-19 13:29:52 -07:00
Eric Astor
3c657ceef9
[ms] [llvm-ml] Add llvm-ml64 alias (#131854)
Rather than requiring users to pass `-m64` to the `llvm-ml` driver to
get 64-bit behavior, we add the `llvm-ml64` alias, matching the behavior
of `ML.EXE` and `ML64.EXE`.

The original flavor/bitness flags still work, but the alias should make
some workflows easier.

NOTE: The logic for this already existed in the code; we're just finally
adding the build/install instructions to match.
2025-03-19 15:02:17 -04:00
Joel Wee
f84bc1ca43 Fix after 2b8f88791502 2025-03-19 17:32:36 +00:00
James Y Knight
25613b32ab NFC: fix whitespace lint in bazel file. 2025-03-19 12:16:09 -04:00
James Y Knight
379a8d1a83
Fix bazel build for 8437b7f5. (#132046)
When using parse_headers validation, rpc_server.h fails to build, since
we don't expose any of the RPC deps in the Bazel build.

So at least for now, just exclude it.
2025-03-19 11:05:51 -04:00
Alexey Samsonov
d039af3309
[libc] Create ErrnoCheckingTest harness to simplify errno tests. (#131703)
See the discussion in PR
https://github.com/llvm/llvm-project/pull/131650 on why we need to clear
the errno at the beginning of some tests, and outlining the various solutions.

Introduce ErrnoCheckingTest base class and use it for unlink_test as an example.
2025-03-18 12:30:53 -07:00
Joel Wee
3ea89e0611 Fix Bazel after 1fbfef9 2025-03-18 14:36:43 +00:00
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