The fact that `hdr/elf_proxy.h` was generated with headergen was causing
dependency issues. This shouldn't be necessary, and this PR moves it out
into `include` to avoid needing headergen for an overlay build.
Assisted-by: Automated tooling, human reviewed.
The IR Outliner has major bugs and no active maintainer, and is disabled
by default. The new LLVM Policy states the pass should be removed.
This commit removes:
- The IROutliner pass
- The IRSimilarity analysis
- The `llvm-sim` executable, used for understanding the latter
- All tests of the above
Related discussion:
https://discourse.llvm.org/t/ir-outliner-status-interest/89672
Adds a default-empty `LLDB_DWO_DIAGNOSTIC_SUFFIX` macro and appends it
to both missing-DWO diagnostics.
The idea is companies or build engineers can build with an extra cmake
-D flag to include internal URL links or troubleshooting tips when dwo
files are missing.
tested with:
```
bin/llvm-lit -sv tools/lldb/test/Shell/SymbolFile/DWARF/x86/dwo-not-found-warning.cpp
```
added `GetDwoDiagnosticSuffix()` because a macro has no runtime symbol.
The function lets lldb-test read the exact value compiled into the DWARF
plugin.
---------
Co-authored-by: Bar Soloveychik <barsolo@fb.com>
When PR# 201283 added windows os select to the build of the Host target,
it missed the exported headers since the CI checks run only linux and
mac (and I hadn't gotten to this in my slow slog of windows bazel lldb
support). I found when translating to BUCK and running into this
compilation error on windows for buck2 built lldb.
Still cannot build and claude tells me the exclude is necessary to avoid
a duplicate.
claude assisted with bazel rule creation
This commit removes the "QueryProfileInterface" and
"QueryExtensionInterface" as they are superfluous in most cases, with
TosaComplianceData.h.inc already providing much of the data we need.
Removing these also helps prevent mistakes as observed in:
https://github.com/llvm/llvm-project/pull/206687
This commit removes these interfaces and updates the profile conformance
to extract supported profile/extension information from
TosaComplianceData.h.inc instead.
One factor that isn't duplicated is operations that rely on extensions,
but do not declare any data type support. This is a small set of
operations, such as tosa.custom, tosa.cond_if, tosa.while_loop and
tosa.const_shape, and we can add them to the TosaComplianceData.h.inc
file as needed.
This commit updates realpath to call `readlinkat` on symlinks during
path resolution.
Some notes on implementation:
- `PendingPath` uses a `cpp::string` to store unprocessed path
components. This could be more efficient by using a `PATH_MAX` buffer
and storing the path at the end of the buffer, which would allow for
easy prepending. However, using a `cpp::string` avoids the pointer
arithmetic and memory management that would involve.
- This PR implements `cpp::string::replace` to avoid pointer arithmetic
inside `realpath`. This should hopefully not be too inefficient, since
`prepend` reuses space from processed path components there's enough
room, there certainly exist some bad inputs that would cause many
`memmove` operations.
Using a pipe avoids races between "hermetic" and "unit" versions of the
same test and avoids leaving filesystem artifacts around if the test
fails. If I'm successful, we won't have the worry about the first
problem anymore, but I think it's still a nice cleanup.
Assisted by Gemini.
This reverts https://github.com/llvm/llvm-project/pull/210889
(b7f642fdb2,
"Revert
recent changes to the hermetic tests"), re-applying
https://github.com/llvm/llvm-project/pull/209999
(9e2e9b33e1,
"[libc] Port process
utilities to hermetic mode and enable some tests") and
https://github.com/llvm/llvm-project/pull/210715
(4bd1a447e1,
"[libc] Make hermetic test
syscall deps linux-only"), which was reverted due to failures on the GPU
bots.
There are a couple of small changes w.r.t the original patches:
- This version disables the exit tests on builds that do not
support subprocess tests (via the newly introduced
LIBC_TEST_SUBPROCESS_TESTS). This is necessary because the GPU builds
contain the relevant entry points, which means their tests are not
skipped automatically.
- fix a typo in a variable name
- make the dependencies conditional on LIBC_TEST_SUBPROCESS_TESTS
instead of listing the target OSs directly. This is a no-op, as that's
exactly how the variable is defined, but it makes the code cleaner.
This replaces the ENABLE_SUBPROCESS_TESTS preprocessor flag with a cmake
variable. By lifting the logic into cmake, we select which test
framework files to build, and also exclude whole tests, if they do not
make sense without subprocess support.
This enables us to fix failures from (now reverted) #209999 and
#210889, as it will let us skip the *exit family of tests. The problem
there was that GPU targets support the *exit entry points (so the
auto-skipping logic does not kick in), but they do not have (and maybe
cannot have?) the functionality necessary to test them.
I convert two libgen tests (the only users of ENABLE_SUBPROCESS_TESTS)
to the new framework.
Adds an @platforms//os:windows branch to the ConfigHeader
expand_template OS select(), alongside the
existing macos/linux branches. On Windows the POSIX-oriented features
are disabled (HAVE_PTSNAME_R,
LLDB_ENABLE_POSIX, LLDB_ENABLE_TERMIOS → 0) and the platform-detection
macros (HAVE_LIBCOMPRESSION,
HAVE_*_PROCESS_VM_READV, HAVE_PPOLL, HAVE_SYS_EVENT_H,
LLDB_ENABLE_LIBXML2, LLDB_HAVE_EL_RFUNC_T) are
set to their Windows values. This complements the recently added Windows
process plugin (#203146) so a
Windows-configured lldb gets a correct Config.h. Python stays disabled
on Windows (base default
LLDB_ENABLE_PYTHON 0).
Continuing to work backwards from Meta's internally working buck2 build
that is translated from this bazel. This lacked windows select entirely,
so porting back what we ended up needing. There are still some changes
needed on the build targets, but leave those to a follow up diff as I
would hope build signals should be clean with this?
https://github.com/llvm/llvm-project/pull/201173 originally started full
windows support and there were more changes to get it working on a
remote build in
https://github.com/hermeticbuild/hermetic-llvm/pull/582/changes#diff-da3f010352329507a9e1e3f1dc911ae4ba69ba9747ce15e5eb76fbefe5f829b3.
If we look at
3rd_party/llvm-project/22.x/patches/lldb-windows-config-header.patch in
the previous patch, it lines up with what we have here.
Meta does package LZMA support into our windows build, so switching to a
config to control that.
Another small piece of windows build support for LLDB in bazel.
Internally at Meta, our buck2 rule for this has a split for mac/linux
with PluginProcessPOSIX and windows with PluginProcessWindowsCommon. So
this should be a no-op for existing linux & mac builds while setting up
a bit more for windows.
I have no bazel build set up locally, so will wait on CI to confirm no
regression.
bazel rule creation assisted with claude
The code will be updated and used for wide character printf functions
implemented in wchar/, so __support/ is a more consistent shared
location.
Assisted-by: Automated tooling, human reviewed.
Windows lldb build support via bazel is still a work in progress.
LLVM_ENABLE_DIA_SDK enables windows specific functionality. With it
hard-coded to 0 here, an override via build args via buck2 (internally
at Meta) of
'-DLLVM_ENABLE_DIA_SDK=1' had no effect. So modify this set of
configurations to allow that build arg to take precedence while avoiding
a larger amount of changes for windows/bazel lldb support (for now).
As cannot build with bazel locally, I will rely on CI to confirm lint
and building.
PR #209999 (9e2e9b33e1) "broke" the GPU
build by causing many/most tests to not run.
The follow-up in #210715 (4bd1a447e1)
broke it for real
(https://lab.llvm.org/buildbot/#/builders/10/builds/32254) by causing
too many tests to run.
I think we just need to disable the extra tests, but I want to start out
by reverting both patches so that it's easier to compare the
before/after state in the next attempt.
Add PredicateExpanderDag.cpp to the glob. Avoid adding
PredicateExpanderDag.h and instead switch to a glob to include all
headers. We can't glob the .cpp files due to a circular dep when
including TargetFeaturesEmitter.cpp.
When writing the test, I assumed that (linux) domain sockets do not
support OOB data, and that sockatmark returns 0, because it can never
read it.
In fact, as of 2021, linux does support OOB on domain sockets, but this
feature can be turned off at build time (CONFIG_AF_UNIX_OOB). In this
case (or in the case of older kernels), the kernel returns an error (and
the test fails).
Armed with this knowledge, I modify the test to test both "1" (OOB
present) and "0" (no OOB data) cases by actually sending OOB data into
the socket. I use the send call to determine the presence of OOB
support, and have the test skip itself if it is absent. OOB data only
makes sense on stream sockets, so change the socketpair type to that.
---------
Co-authored-by: Jeff Bailey <jbailey@raspberryginger.com>
Add bazel build targets for the remaining arpa/inet functions
(inet_addr, inet_aton, inet_ntoa, and inet_ntop) along with their unit
tests and supporting targets (__support_net_address, headers, and proxy
types).
Assisted by Gemini.
This is achieved by calling internal libc functions in hermetic mode. In
the overlay mode I keep calling the system functions so that the tests
work even on systems which don't have these implemented.
I also needed to implement the delete operators as both the libc proper
and the test framework uses them nowadays.
This is sufficient to enable all stdlib tests in hermetic mode, except
for one, which actually exposes a bug in the implementation. I'll deal
with that in a separate patch.
This change adds SymbolUserTypeInterface, analogous to
SymbolUserAttrInterface, and extends SymbolTable verification to check
participating types.
Verification visits the types owned by an operation, (operand/result
types, block argument types, attribute-contained types, nested type
parameters) and checks each distinct type at most once, interrupting on
the first failure. Deduplication spans the whole symbol-table walk, so a
type used by multiple operations is checked only once.
Attribute (SymbolUserAttrInterface) verification also gets deduped the
same way.
Assisted-by: Codex (OpenAI)
Assisted-by: Claude (Anthropic)
Several call sites still invoked syscall_impl directly (or carried
their own SYS_* fallback ladders) for syscalls that already have a
wrapper in src/__support/OSUtil/linux/syscall_wrappers.
This PR removes these syscalls in favor of the syscall_wrappers.
Another missing plugin and its libraries in the LLDB bazel build. Based
this one on source/Plugins/ObjectContainer/Big-Archive/CMakeLists.txt
and its dependecies ( {}.cpp & {}.h)
waiting on CI to confirm bazel is correct as cannot build locally.
Can confirm this library will convert to BUCK internally at Meta and
build with buck2 where we do have in the default plugin list.
bazel rule assisted with: claude
This patch adds the following sys/socket functions and syscall wrapper
libraries to BUILD.bazel:
- accept
- accept4
- bind
- connect
- getpeername
- getsockname
- listen
- sockatmark
I'm also enabling the unit tests for these functions. Running AF_UNIX
socket tests under Bazel ran into a problem where the absolute path to
the test sandbox directory exceeds the 108-byte limit of
sockaddr_un::sun_path. To work around that, I added a TestDirectoryScope
helper that temporarily chdirs into the test directory so the tests can
use short relative filenames, and restores the original working
directory on exit.
Assisted by Gemini.
Move failed payload handling from `clangd::LSPBinder::parse<T>` and
`llvm::lsp::MessageHandler::parse<T>` into their non-inline
`handleParseError` functions, while keeping successful payload
conversion specialized in each `parse<T>` instantiation.
For a Darwin arm64 build, stripped clangd decreased by 32,848 bytes and
`__TEXT,__text` decreased by 25,180 bytes.
`ClangdTests --gtest_filter=LSPBinderTest.*` passes, and
`llvm/lib/Support/LSP/Transport.cpp` passes a standalone syntax compile.
Work towards #202616
AI tool disclosure: Co-authored with OpenAI Codex.
Co-authored-by: OpenAI Codex <noreply@openai.com>
Instead of duplicate inv trig helpers for float and double. we can unify
them when that is possible and drop inv_trigf_utils after moving helpers
to asin_utils and atan_utils. That makes everything clean.
This change should not change the behavior of tests but instead ensure
that no matter where a test is run (either as an external repo or as an
overlay from `./utils/bazel`) that the rendered source paths are correct
for that context.