0
0
mirror of https://github.com/llvm/llvm-project.git synced 2025-04-20 16:27:12 +00:00

67 Commits

Author SHA1 Message Date
Christian Sigg
71037ee9de [llvm][bazel] Port 667209e45122d0cb7a4c2ac27018d31165b1be70. 2025-04-20 07:56:05 +02:00
Vy Nguyen
159b872b37
[llvm][telemetry]Change Telemetry-disabling mechanism. ()
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
Christian Sigg
ec056f5458 [llvm][bazel] Adjust to HAVE_SYS_AUXV_H > HAVE_GETAUXVAL in 89d636ba91 2025-02-13 08:08:52 +01:00
NAKAMURA Takumi
9bd836adbb [bazel] Introduce HAVE_SYS_AUXV_H for 2025-02-13 13:07:19 +09:00
Mikhail Goncharov
2dd2608105 [bazel] port fc4d87100a01f08dbdf78b68e1a6a5c2584d840d 2025-02-12 16:39:47 +01:00
Fangrui Song
58c6d440f8
[CMake] Remove HAVE_DLFCN_H and HAVE_DLADDR ()
It is sufficient to just use `HAVE_DLOPEN`.
2025-01-22 08:15:10 -08:00
Fangrui Song
414980d061
[CMake] Remove HAVE_SYS_RESOURCE_H/HAVE_SETRLIMIT/HAVE_GETRLIMIT
Only used by Unix/Program.inc and seem always available.

Pull Request: https://github.com/llvm/llvm-project/pull/123288
2025-01-16 22:44:54 -08:00
Fangrui Song
219beb7aca [CMake] Remove HAVE_SYS_IOCTL_H 2025-01-16 21:52:01 -08:00
Fangrui Song
86a81d424c [CMake] Remove HAVE_TERMIOS_H
The code path has been dead since 2019.
See a3eb3d3d92d037fe3c9deaad87f6fc42fe9ea766
2025-01-16 21:48:27 -08:00
Fangrui Song
f999b11e68
[CMake] Remove some unneeded HAVE_*_H
Pull Request: https://github.com/llvm/llvm-project/pull/123282
2025-01-16 21:37:24 -08:00
Fangrui Song
1e53f9523d
[CMake] Remove some always-true HAVE_XXX_H
These are unneeded even on AIX, PURE_WINDOWS, and ZOS (per )

* HAVE_ERRNO_H: introduced by 1a93330ffa2ae2aa0b49461f05e6f0d51e8443f8 (2009) but unneeded.
  The guarded ABI is unconditionally used by lldb.
* HAVE_FCNTL_H
* HAVE_FENV_H
* HAVE_SYS_STAT_H

Pull Request: https://github.com/llvm/llvm-project/pull/123087
2025-01-15 09:53:21 -08:00
Augie Fackler
e8b9e1354a [bazel] update config.h.cmake
for 4dafb091a0336a6669e6369cb69ef1ea1b39578d
reverts 1a1de2465d8399b178149e7e23c7450fdc5dde9f
2024-12-03 13:16:58 -05:00
Mikhail Goncharov
1a1de2465d [bazel] update abi-breaking.h.cmake for 3be691651a2143f23bcf8f2704e55b01bbaa2550 2024-10-09 11:09:13 +02:00
Mikhail Goncharov
f016e105b3 [bazel] update config.h.cmake
for 84088d3a28fdc2d6314c59bfa11026a72b9b0bff
2024-10-09 11:02:30 +02:00
Fangrui Song
125635eb68 [CMake] Remove unused HAVE_SYS_PARAM_H/HAVE_SYS_TYPES_H 2024-09-17 22:55:53 -07:00
Christian Sigg
e90b21959a
[llvm][bazel] Port 1e65b76 to bazel.
1e65b76587
2024-09-02 13:33:49 +02:00
Fangrui Song
7c06786479
[CMake] Remove HAVE_LINK_H
We can remove the variable from https://reviews.llvm.org/D5610 since
link.h is available on Linux (glibc/musl/Bionic), FreeBSD, and NetBSD.
Use `__has_include(<link.h>)` before including it.

Pull Request: https://github.com/llvm/llvm-project/pull/104893
2024-08-20 08:50:24 -07:00
Aaron Siddhartha Mondal
852aaf5407
Reapply "[Support] Remove terminfo dependency ()" ()
This reverts commit fe82a3da36196157c0caa1ef2505186782f750d1.

This broke LLDB on MacOS due to a missing symbol during linking.

The fix has been applied in c6c08eee37bada190bd1aa4593c88a5e2c8cdaac.

Original commit message:

The terminfo dependency introduces a significant nonhermeticity into the
build. It doesn't respect `--no-undefined-version` meaning that it's not
a dependency that can be built with Clang 17+. This forces maintainers
of source-based distributions to implement patches or ignore linker
errors.

Remove it to reduce the closure size and improve portability of
LLVM-based tools. Users can still use command line arguments to toggle
color support expliticly.

Fixes 
Closes  
2024-05-31 01:29:00 +02:00
Michael Buch
fe82a3da36 Revert "[Support] Remove terminfo dependency ()"
This reverts commit 6bf450c7a60fa62c642e39836566da94bb9bbc91.

It breaks LLDB CI: https://green.lab.llvm.org/job/llvm.org/view/LLDB/job/as-lldb-cmake/4762/execution/node/97/log/

```
/Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ -Wdocumentation -fPIC -fvisibility-inlines-hidden -Werror=date-time -Werror=unguarded-availability-new -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -pedantic -Wno-long-long -Wc++98-compat-extra-semi -Wimplicit-fallthrough -Wcovered-switch-default -Wno-noexcept-type -Wnon-virtual-dtor -Wdelete-non-virtual-dtor -Wsuggest-override -Wstring-conversion -Wmisleading-indentation -Wctad-maybe-unsupported -fdiagnostics-color -Wno-deprecated-declarations -Wno-unknown-pragmas -Wno-strict-aliasing -Wno-deprecated-register -Wno-vla-extension -O3 -DNDEBUG -arch arm64 -isysroot /Applications/Xcode-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.2.sdk -mmacosx-version-min=14.1 -Wl,-search_paths_first -Wl,-headerpad_max_install_names -Wl,-dead_strip -Wl,-no_warn_duplicate_libraries tools/lldb/unittests/Editline/CMakeFiles/EditlineTests.dir/EditlineTest.cpp.o -o tools/lldb/unittests/Editline/EditlineTests  lib/libLLVMSupport.a  lib/libllvm_gtest_main.a  lib/libllvm_gtest.a  lib/liblldbHost.a  lib/liblldbUtility.a  lib/libLLVMTestingSupport.a  /Applications/Xcode-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.2.sdk/usr/lib/libxml2.tbd  /Applications/Xcode-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.2.sdk/usr/lib/libedit.tbd  lib/liblldbHostMacOSXObjCXX.a  lib/liblldbUtility.a  -framework Foundation  -framework CoreFoundation  -framework CoreServices  -framework Security  lib/libLLVMObject.a  lib/libLLVMIRReader.a  lib/libLLVMBitReader.a  lib/libLLVMAsmParser.a  lib/libLLVMCore.a  lib/libLLVMRemarks.a  lib/libLLVMBitstreamReader.a  lib/libLLVMMCParser.a  lib/libLLVMMC.a  lib/libLLVMDebugInfoCodeView.a  lib/libLLVMTextAPI.a  lib/libLLVMBinaryFormat.a  lib/libLLVMTargetParser.a  lib/libllvm_gtest.a  lib/libLLVMSupport.a  -lm  /Applications/Xcode-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.2.sdk/usr/lib/libz.tbd  /opt/homebrew/lib/libzstd.dylib  lib/libLLVMDemangle.a  -lpthread && cd /Users/ec2-user/jenkins/workspace/llvm.org/as-lldb-cmake/lldb-build/tools/lldb/unittests/Editline && /opt/homebrew/Cellar/cmake/3.28.3/bin/cmake -E make_directory /Users/ec2-user/jenkins/workspace/llvm.org/as-lldb-cmake/lldb-build/tools/lldb/unittests/Editline/./Inputs
ld: Undefined symbols:
  _setupterm, referenced from:
      lldb_private::Editline::Editline(char const*, __sFILE*, __sFILE*, __sFILE*, std::__1::recursive_mutex&) in liblldbHost.a[35](Editline.cpp.o)
clang: error: linker command failed with exit code 1 (use -v to see invocation)
```
2024-05-29 16:20:42 +01:00
Christian Sigg
76e1a535fd [llvm][bazel] Fix llvm-config after 3613b2683107bd60fda6d9348623be0686f6d7e3. 2024-05-29 09:45:51 +02:00
Aaron Siddhartha Mondal
6bf450c7a6
[Support] Remove terminfo dependency ()
The terminfo dependency introduces a significant nonhermeticity into the
build. It doesn't respect `--no-undefined-version` meaning that it's not
a dependency that can be built with Clang 17+. This forces maintainers
of source-based distributions to implement patches or ignore linker
errors.

Remove it to reduce the closure size and improve portability of
LLVM-based tools. Users can still use command line arguments to toggle
color support expliticly.

Fixes 
Closes  
2024-05-24 20:20:15 +02:00
NAKAMURA Takumi
ba5dad35fb [Bazel] Enable LLVM_VERSION_PRINTER_SHOW_BUILD_CONFIG (for ) 2024-04-07 11:02:08 +09:00
NAKAMURA Takumi
5f254eb055 [Bazel] Fixup for
This also reverts 7c9c807fa433 and 476812a74260.
2023-12-23 00:08:39 +09:00
Christian Sigg
476812a742 [bazel] Update config.h.cmake after e86a02ce89c33f3fa4061fb4c67c3b05c69a72ab. 2023-12-20 16:07:46 +01:00
Jorge Gorbe Moya
671741bb9c [bazel] update utils/bazel/llvm_configs/llvm-config.h.cmake after 3fe69bab1149 2023-11-03 16:30:58 -07:00
Mikhail Goncharov
7a18b3ce65 [bazel] update llvm-config.h.cmake
after 28bb2193f6d3bb52f6bba9c64e392fe6c8be0f88
2023-10-12 10:20:45 +02:00
Juergen Ributzka
eb601430d3
[llvm][objdump] Remove support for printing the embedded Bitcode section in MachO files. ()
It's no longer possible to submit bitcode apps to the Apple App Store.
The tools
used to create xar archived bitcode sections inside MachO files have
been
discontinued. Additionally, the xar APIs have been deprecated since
macOS 12,
so this change removes unnecessary code from objdump and all
dependencies on
libxar.

This fixes rdar://116600767
2023-10-09 15:03:29 -07:00
Mikhail Goncharov
6de59222e2 [bazel] update config.h.cmake 2023-07-21 17:38:28 +02:00
Fangrui Song
43bec3376c Remove HAVE_STRERROR
Most systems support strerror_r. For the remaining systems (e.g. MSVC) strerror_s and
strerror can be used as fallbacks. We don't have a supported operating
system/compiler that doesn't provide `strerror`.

Close https://github.com/llvm/llvm-project/issues/62804

https://github.com/flang-compiler/f18/pull/1068 added a fallback
when strerror is unavailable, but I think the code path is dead.

Reviewed By: serge-sans-paille, vzakhari

Differential Revision: https://reviews.llvm.org/D151718
2023-05-30 14:12:20 -07:00
Khem Raj
5cd554303e cmake: Enable 64bit off_t on 32bit glibc systems
Pass -D_FILE_OFFSET_BITS=64 to compiler flags on 32bit glibc based
systems. This will make sure that 64bit versions of LFS functions are
used e.g. seek will behave same as lseek64. Also revert [1] partially
because this added a cmake test to detect lseek64 but then forgot to
pass the needed macro to actual compile, this test was incomplete too
since libc implementations like musl has 64bit off_t by default on 32bit
systems and does not bundle[2] -D_LARGEFILE64_SOURCE under -D_GNU_SOURCE
like glibc, which means the compile now fails on musl because the cmake
check passes but we do not have _LARGEFILE64_SOURCE defined. Using the
*64 function was transitional anyways so use -D_FILE_OFFSET_BITS=64
instead

[1] 8db7e5e4ee
[2] https://git.musl-libc.org/cgit/musl/commit/?id=25e6fee27f4a293728dd15b659170e7b9c7db9bc

Reviewed By: MaskRay

Differential Revision: https://reviews.llvm.org/D139752
2023-02-04 13:54:41 -08:00
Benjamin Kramer
9f6f9488dd Revert "[Bazel] Remove define HAVE_LSEEK64 to match cmake config."
This reverts commit 5d65f8a7931c160fe5a11c120796779ba59789b9. Dependent
commit ae3e228af7 was reverted in f31a36e7767e.
2022-12-20 20:33:20 +01:00
Adrian Kuegel
5d65f8a793 [Bazel] Remove define HAVE_LSEEK64 to match cmake config. 2022-12-19 09:06:39 +01:00
Haojian Wu
1651bc60ad Update the bazel's llvm-config.h.cmake file
Reflect the change 7d2c1150d31bb3692c81f6ecb0dbe61170e31212, fix the bazel test
breakage.
2022-12-17 18:17:30 +01:00
Jordan Rupprecht
58c38e4536 [NFC][bazel] Update comment in llvm-config.h.cmake so headers match 2022-12-15 17:41:48 -08:00
Kazu Hirata
ee0c631716 [mlgo] Retire LLVM_HAVE_TF_API
I've eliminated all uses of LLVM_HAVE_TF_API except a couple of them
being removed in llvm/lib/CodeGen/CMakeLists.txt.  This patch removes
remaining definitions and uses of LLVM_HAVE_TF_API.

Differential Revision: https://reviews.llvm.org/D140169
2022-12-15 14:40:16 -08:00
Mircea Trofin
5ce4c9aa04 [mlgo] Use TFLite for 'development' mode.
TLite is a lightweight, statically linkable[1], model evaluator, supporting a
subset of what the full tensorflow library does, sufficient for the
types of scenarios we envision having. It is also faster.

We still use saved models as "source of truth" - 'release' mode's AOT
starts from a saved model; and the ML training side operates in terms of
saved models.

Using TFLite solves the following problems compared to using the full TF
C API:

- a compiler-friendly implementation for runtime-loadable (as opposed
  to AOT-embedded) models: it's statically linked; it can be built via
  cmake;
- solves an issue we had when building the compiler with both AOT and
  full TF C API support, whereby, due to a packaging issue on the TF
  side, we needed to have the pip package and the TF C API library at
  the same version. We have no such constraints now.

The main liability is it supporting a subset of what the full TF
framework does. We do not expect that to cause an issue, but should that
be the case, we can always revert back to using the full framework
(after also figuring out a way to address the problems that motivated
the move to TFLite).

Details:

This change switches the development mode to TFLite. Models are still
expected to be placed in a directory - i.e. the parameters to clang
don't change; what changes is the directory content: we still need
an `output_spec.json` file; but instead of the saved_model protobuf and
the `variables` directory, we now just have one file, `model.tflite`.

The change includes a utility showing how to take a saved model and
convert it to TFLite, which it uses for testing.

The full TF implementation can still be built (not side-by-side). We
intend to remove it shortly, after patching downstream dependencies. The
build behavior, however, prioritizes TFLite - i.e. trying to enable both
full TF C API and TFLite will just pick TFLite.

[1] thanks to @petrhosek's changes to TFLite's cmake support and its deps!
2022-08-24 16:07:24 -07:00
Kazu Hirata
36357c967c Remove llvm::is_trivially_copyable (NFC)
This patch removes llvm::is_trivially_copyable as it seems to be dead.
Once I remove it, HAVE_STD_IS_TRIVIALLY_COPYABLE has no users, so this
patch removes the macro also.

The comment on llvm::is_trivially_copyable mentions GCC 4.9, but note
that we now require GCC 7.1 or higher.

Differential Revision: https://reviews.llvm.org/D132328
2022-08-21 10:39:19 -07:00
Cole Kissane
e939bf67e3 [llvm] add zstd to llvm::compression namespace
- add zstd to `llvm::compression` namespace
- add a CMake option `LLVM_ENABLE_ZSTD` with behavior mirroring that of `LLVM_ENABLE_ZLIB`
- add tests for zstd to `llvm/unittests/Support/CompressionTest.cpp`
- debian users should install libzstd when using `LLVM_ENABLE_ZSTD=FORCE_ON` from source due to this bug https://bugs.launchpad.net/ubuntu/+source/libzstd/+bug/1941956

Reviewed By: leonardchan, MaskRay

Differential Revision: https://reviews.llvm.org/D128465
2022-07-19 10:54:36 -07:00
Amara Emerson
6e6be5f950 Revert "[llvm] add zstd to llvm::compression namespace"
This reverts commit d449c600767284486615f3b79601ced15a00af61.

Breaks macOS builds with this:
llvm/lib/Support/Compression.cpp:24:10: fatal error: 'zstd.h' file not found
2022-07-14 01:23:20 -07:00
Cole Kissane
d449c60076 [llvm] add zstd to llvm::compression namespace
- add `FindZSTD.cmake`
- add zstd to `llvm::compression` namespace
- add a CMake option `LLVM_ENABLE_ZSTD` with behavior mirroring that of `LLVM_ENABLE_ZLIB`
- add tests for zstd to `llvm/unittests/Support/CompressionTest.cpp`

Reviewed By: leonardchan, MaskRay

Differential Revision: https://reviews.llvm.org/D128465
2022-07-13 19:58:42 -07:00
Cole Kissane
5ecb161c64 Revert "[llvm] add zstd to llvm::compression namespace"
This reverts commit cef07169ec9f46fd25291a3218cf12bef324ea0c.
2022-07-13 19:48:29 -07:00
Cole Kissane
cef07169ec [llvm] add zstd to llvm::compression namespace
- add `FindZSTD.cmake`
- add zstd to `llvm::compression` namespace
- add a CMake option `LLVM_ENABLE_ZSTD` with behavior mirroring that of `LLVM_ENABLE_ZLIB`
- add tests for zstd to `llvm/unittests/Support/CompressionTest.cpp`

Reviewed By: leonardchan, MaskRay

Differential Revision: https://reviews.llvm.org/D128465
2022-07-13 19:06:27 -07:00
Leonard Chan
474c873148 Revert "[llvm] cmake config groundwork to have ZSTD in LLVM"
This reverts commit f07caf20b9d35e45501c9d5d903fa182b3bdb95a which seems to break upstream https://lab.llvm.org/buildbot/#/builders/109/builds/42253.
2022-07-08 13:48:05 -07:00
Cole Kissane
f07caf20b9 [llvm] cmake config groundwork to have ZSTD in LLVM
- added `FindZSTD.cmake`
- added a CMake option `LLVM_ENABLE_ZSTD` with behavior mirroring that of `LLVM_ENABLE_ZLIB`
- likewise added have_zstd to compiler-rt/test/lit.common.cfg.py, clang-tools-extra/clangd/test/lit.cfg.py, and several lit.site.cfg.py.in files mirroring have_zlib behavior

Reviewed By: leonardchan, MaskRay

Differential Revision: https://reviews.llvm.org/D128465
2022-07-08 11:46:52 -07:00
Adrian Kuegel
f066a0cd21 [llvm][Debuginfod][Bazel] Match dependencies in CMakeLists.txt.
Also update llvm-config.h and llvm-config.h.cmake to match 484b1aa611caa70c8a80b46060cc340bbeee8306

Differential Revision: https://reviews.llvm.org/D129252
2022-07-07 09:25:52 +02:00
Reid Kleckner
570e76bb6c [config] Remove vestigial LLVM_VERSION_INFO
This has been superseded by the llvm/Support/VCSRevision.h header. So
far as I can tell, nothing in the CMake build sets LLVM_VERSION_INFO. It
was always undefined, and the ifdefs using it were dead. However, CMake
is very flexible, so it's possible that I missed some ways to set this
variable. One could, for example, probably pass -DLLVM_VERSION_INFO=x on
the command line and get that through to configure_file, or set the
variable in an obscure way (`set(${proj}_VERSION_INFO "x")`). I'm
reasonably confident that isn't happening, but I'd like a second
opinion.

Update the Bazel and gn builds accordingly.

Differential Revision: https://reviews.llvm.org/D126977
2022-06-07 11:36:26 -07:00
Reid Kleckner
b1c7889f32 [config] Remove RETSIGTYPE from config.h.cmake, NFC
This doesn't need to be configurable. It was hardcoded to void in all
LLVM build systems.
2022-06-07 11:35:25 -07:00
Reid Kleckner
d82b4fe50d [bazel] Update build for config.h.cmake change 2022-06-03 12:58:04 -07:00
Fangrui Song
a8ef1647aa [CMake][gn][Bazel] Remove HAVE_PTHREAD_GETSPECIFIC
The only user was removed by d351f54a076edf24c2a2bfda7cc7e3313ee3eecf.
2022-04-11 14:44:45 -07:00
Benjamin Kramer
6b15157610 [bazel] Port 3031fa88f0 2022-04-07 12:14:14 +02:00