2662 Commits

Author SHA1 Message Date
Yijia Gu
a557550fa4 [clang][bazel] add missing target 2025-04-08 11:06:52 -07:00
Christian Sigg
4e9cfcf6af [llvm][bazel] Fix BUILD after 561506144531cf0a760bb437fd74c683931c60ae. 2025-04-08 17:28:20 +02:00
Christian Sigg
3a6b9b3a87 [mlir][bazel] Fix after dae0ef53a0b99c6c2b74143baee5896e8bc5c8e7
Remove unnecessary include.
2025-04-08 15:47:14 +02:00
Jorge Gorbe Moya
99d12ac172 [bazel] Fix build after 65813e0e94c0403dad61e8365b39d76d7b3bfc14 2025-04-07 17:03:30 -07:00
Pranav Kant
4607d39c7e
[bazel] Fix build (#134697)
Fixes fallback from #134439
2025-04-07 10:36:38 -07:00
Christian Sigg
9fe6f6a0d4
[bazel] Change gentbl_cc_library(tbl_outs) to dicts (#134349)
Follow up from https://github.com/llvm/llvm-project/pull/134271
2025-04-07 14:23:22 +02:00
Jorge Gorbe Moya
109566a3d0
[bazel] Fold "${Target}Analysis" targets into their respective CodeGen targets. (#134312)
After 3801bf6164f570a145e3ebd20cf9114782ae0329, SPIRVAnalysis needs to
include SPIRV.h provided by SPIRVCodegen, but the CodeGen target already
depends on Analysis, so that would cause a circular dependency.

Analysis is a subdirectory of CodeGen so it makes sense as a part of the
main CodeGen target too.
2025-04-03 15:21:26 -07:00
Jorge Gorbe Moya
158684a80f [bazel] Add missing dep after 586c5e3083428e7473e880dafd5939e8707bc1c9 2025-04-03 11:25:44 -07:00
Christian Sigg
6ddf7cf780
[mlir][bazel] Allow gentbl_cc_library(tbl_outs) to be a dict. (#134271)
This makes the BUILD file shorter and more readable.
I will follow up with converting the other instances.
2025-04-03 18:47:56 +02:00
Jorge Gorbe Moya
990a086d9d [bazel] Add missing dep after 51d1c7288662ea801b07133fd2d22aff6bac50e2 2025-04-02 15:17:06 -07:00
Amy Huang
f475ccd379
Fix to the libc BUILD.bazel file after changing atan_utils.h deps. (#134128)
Additional fix for libc BUILD.bazel after commit 8741412 (#133980)

This seems to match libc/src/math/generic/CMakeLists.txt.
2025-04-02 11:05:36 -07:00
NAKAMURA Takumi
3cc7148fe0 [bazel] Update for #134043 2025-04-02 20:29:52 +09:00
Alexey Samsonov
07504afc42
[libc] Stop depending on .cpp files in libcxx_shared_headers library. (#133999)
Fix two instances of libcxx_shared_headers depending on .cpp files (in
Bazel build):

* Don't depend on exit syscall in LIBC_ASSERT implementation. This
dependency is not used, since LIBC_ASSERT always uses system <assert.h>
in the overlay mode, which is the only mode supported by Bazel.
* Don't depend on libc_errno in str-to-float and str-to-integer
conversions. We only need the ERANGE value, which can be obtained from
the proxy header instead.
2025-04-01 16:23:19 -07:00
Amy Huang
537b6541e8
Fix libc BUILD.bazel after commit 8741412 (#133980)
Recent changes add dependencies to some atan functions. Edit bazel build
file to look more like the CMake file.


See
8741412bdf
2025-04-01 13:32:43 -07:00
Jeremy Kun
179062b2dc
[mlir][bazel] add alwayslink=True to mlir-runner utils (#133787)
MacOS platforms using mlir-runner in lit tests consistently hit the
following error:

```
# .---command stderr------------
# | JIT session error: Symbols not found: [ __mlir_ciface_printMemrefI32 ]
# | Error: Failed to materialize symbols: { (main, { __mlir_printMemrefI32, ... }) }
# `-----------------------------
```

https://github.com/google/heir/issues/1521#issuecomment-2751303404
confirms the issue is fixed by using `alwayslink` on these two targets,
and I confirmed on a separate Apple M1 (OSX version Sequoia 15.3.2.).

I'm not an expert on the mlir runner internals, but given the
mlir-runner is purely for testing, and alwayslink at worst adds some
overhead by not removing symbols, it seems low risk.
2025-04-01 08:58:32 -07:00
Keith Smiley
f30c6a047d
[bazel] Format BUILD files with buildifier (#133802) 2025-03-31 14:38:58 -07:00
Jorge Gorbe Moya
514536731f [bazel] Add missing dep after e4b9486056fab7a262fdafbe70acf393c9767d12 2025-03-31 11:29:09 -07:00
Benjamin Kramer
10dd404d9f [bazel] Make DeltaPasses.def available for fea6b388055284f37852e615fbf5b40a3ba34249 2025-03-30 13:12:18 +02:00
Alexey Samsonov
d724bab806
[libc][bazel] Create a libc_header_library macro for hand-in-hand. (#133131)
Create a proper way to build header-only libraries for llvm-libc code
sharing. Use it to group headers that can be shared with libcxx for
std::from_chars() implementation.

It mostly works, though the macro needs to be updated to enforce that no
.cpp files are listed in dependencies (it's not the case now) - see PR
#133126.
2025-03-26 14:10:41 -07:00
Alexey Samsonov
f0b752e921
[libc][bazel] Stop creatng "public" library targets in libc_function. (#132995)
All downstream users are migrated, so we no longer need to produce
"public"/"release" cc_library target for each libc_function macro
invocation. Instead, we only create internal target (for testing), and
some filegroups, which will be picked up by the libc_release_library
invocation.

This allows us to get rid of "weak" argument to libc_function - this
decision is also postponed to libc_release_library configuration.

Fixes #130327.
2025-03-25 14:38:37 -07:00
Walter Lee
6ddc07163d
Disable some tests on bazel (#132951)
These tests failed at Google after #130757. Disable them in bazel for the time being.
2025-03-25 13:06:20 -04:00
Karlo Basioli
cca9b55f54
Fix bazel test errors caused by #131462 (#132929) 2025-03-25 12:57:09 +00:00
Karlo Basioli
36b36060a1
[mlir][spirv] Fix cyclical dependency in bazel (#132785) 2025-03-25 10:39:04 +00:00
Alexey Samsonov
5a668bdb98
[libc] Migrate sys/epoll tests to use ErrnoCheckingTest. (#132823)
This is similar to PR #132107 but for tests for sys/epoll.h functions.

ErrnoCheckingTest ensures that errno is properly reset at the beginning
of the test case, and is validated at the end of it, so that the manual
code such as the one proposed in PR #131650 would not be necessary.
2025-03-24 13:54:46 -07:00
Karlo Basioli
6c68cc4df1
Fix bazel demangle include error caused by #126688 (#132790) 2025-03-24 17:48:01 +00:00
Karlo Basioli
63e0da45a1
Fix bazel DWARF include error caused by #131645 (#132789) 2025-03-24 17:47:47 +00:00
Jordan Rupprecht
c7e6ee7b9f
[bazel] Port 3aa20c266c97a638c63b5368d89fe25757885178 (#132774) 2025-03-24 11:39:09 -05:00
Karlo Basioli
2f2c02e671
Fix bazel build unique function test caused by #ef3e521 (#132726) 2025-03-24 12:31:16 +00:00
Karlo Basioli
997707172f
Fix blaze build caused by commit #5d8e8e8 (#132719) 2025-03-24 12:04:43 +00:00
Karlo Basioli
ad9630d5ee
Fix bazel build for QuantDialectBytecodeGen (caused by #120172) (#132716) 2025-03-24 11:22:40 +00:00
Harrison Hao
445837a363
[libc][math][c23] Add fmaf16 C23 math function. (#130757)
Implementation of fmaf16 function for 16-bit inputs.
2025-03-23 10:48:56 +08:00
lntue
a17b03f0e4
[libc][math] Implement fast pass for double precision atan function. (#132333)
Implement fast pass for double precision `atan` using range reduction
modulo 1/64 and degree-9 Taylor polynomial.
Relative error is bounded by 2^-66.
2025-03-21 14:12:06 -04:00
Michael Jones
fe6bced9e4
[libc][bazel] fix scanf after #131043 (#132305)
The scanf and fscanf implementations were moved into /generic, update
the bazel targets.
2025-03-20 17:04:45 -07:00
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