Commit Graph

45 Commits

Author SHA1 Message Date
NAKAMURA Takumi
5f254eb055 [Bazel] Fixup for #76163
This also reverts 7c9c807fa4 and 476812a742.
2023-12-23 00:08:39 +09:00
Christian Sigg
476812a742 [bazel] Update config.h.cmake after e86a02ce89. 2023-12-20 16:07:46 +01:00
Jorge Gorbe Moya
671741bb9c [bazel] update utils/bazel/llvm_configs/llvm-config.h.cmake after 3fe69bab11 2023-11-03 16:30:58 -07:00
Mikhail Goncharov
7a18b3ce65 [bazel] update llvm-config.h.cmake
after 28bb2193f6
2023-10-12 10:20:45 +02:00
Juergen Ributzka
eb601430d3
[llvm][objdump] Remove support for printing the embedded Bitcode section in MachO files. (#68457)
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 5d65f8a793. Dependent
commit ae3e228af7 was reverted in f31a36e776.
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 7d2c1150d3, 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 d449c60076.

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 cef07169ec.
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 f07caf20b9 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 484b1aa611

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 d351f54a07.
2022-04-11 14:44:45 -07:00
Benjamin Kramer
6b15157610 [bazel] Port 3031fa88f0 2022-04-07 12:14:14 +02:00
Nikita Popov
ed4e6e0398 [cmake] Remove LLVM_ENABLE_NEW_PASS_MANAGER cmake option
Or rather, error out if it is set to something other than ON. This
removes the ability to enable the legacy pass manager by default,
but does not remove the ability to explicitly enable it through
various flags like -flegacy-pass-manager or -enable-new-pm=0.

I checked, and our test suite definitely doesn't pass with
LLVM_ENABLE_NEW_PASS_MANAGER=OFF anymore.

Differential Revision: https://reviews.llvm.org/D123126
2022-04-06 09:52:21 +02:00
Sterling Augustine
61d5d12ca9 Update llvm-config.h.cmake for 7b983917d4 2022-03-18 12:59:15 -07:00
Benjamin Kramer
d3f4562cbd [bazel] Sync llvm-config.h after 112aafcaf4 2022-03-18 10:45:54 +01:00
Sterling Augustine
6f958b6ff5 Update llvm-config.h.cmake for LLVM_UNREACHABLE_OPTIMIZE 2022-03-17 19:04:42 -07:00
Adrian Kuegel
7c786240bc [Bazel] Update llvm-config.h to follow the typo fix. 2022-02-16 14:56:20 +01:00
Benjamin Kramer
356705f94f [bazel] Sync llvm-config.h.cmake after a1862d78eb 2022-02-09 11:28:25 +01:00
Fangrui Song
c27890b5fd [Bazel] Port e8bff9ae54 (move LLVM_ENABLE_ZLIB) 2022-02-07 11:45:31 -08:00
Tres Popp
99b5a8049b Match bazel config with cmake after f29256a64 2022-01-21 09:50:05 +01:00
Fangrui Song
98e0b2cf70 [Support] Revert posix_fallocate in resize_file
This reverts 3816c53f04 and removes follow-up
fixups.

The original intention was to show error earlier (posix_fallocate time) than
later for ld.lld but it appears to cause some problems which make it not free.

* FreeBSD ZFS: EINVAL, not too bad.
* FreeBSD UFS: according to khng "devastatingly slow on freebsd because UFS on freebsd does not have preallocation support like illumos. It zero-fills."
* NetBSD: maybe EOPNOTSUPP
* Linux tmpfs: unless tmpfs is set up to use huge pages (requires CONFIG_TRANSPARENT_HUGE_PAGECACHE=y), I can consistently demonstrate ~300ms delay for a 1.4GiB output.
* Linux ext4: I don't measure any benefit, either backed by a hard disk or by a file in tmpfs.
* The current code organization of `defined(HAVE_POSIX_FALLOCATE)` costs us a macro dispatch for AIX.

I think we should just remove it. I think if posix_fallocate ever finds demonstrable benefit,
it is likely Linux specific and will not need HAVE_POSIX_FALLOCATE, and possibly opt-in by some specific programs.

In a filesystem with CoW and compression, the ENOSPC benefit may be lost as well.

Reviewed By: khng300

Differential Revision: https://reviews.llvm.org/D115957
2021-12-20 11:16:03 -08:00
Dmitri Gribenko
fac18d7377 [Bazel] Add LLVM_BUILD_* variables to llvm-config.h to mirror ec37e0bbaf 2021-12-16 20:56:16 +01:00
Reid Kleckner
c6cfd385b1 [Bazel] Add LLVM_ENABLE_CURL to Bazel llvm-config.h.cmake for e0b259f2 2021-12-02 16:15:48 -08:00
Tres Popp
7d323dc773 Add Bazel support for LLVM_WINDOWS_PREFER_FORWARD_SLASH
This was added in df0ba47c36
2021-11-05 10:04:52 +01:00
Geoffrey Martin-Noble
011d8633eb [Bazel] Update config for 070315d04c
This updates the Bazel configuration for
https://github.com/llvm/llvm-project/commit/070315d04c6b which moved
`LLVM_SUPPORT_XCODE_SIGNPOSTS` from llvm-config.h.cmake to
config.h.cmake.

Also adds a comment for `HAVE_PROC_PID_RUSAGE`, that I spotted was
missing.

Differential Revision: https://reviews.llvm.org/D111569
2021-10-11 11:44:38 -07:00
Geoffrey Martin-Noble
b51e71fe66 [Bazel] Update for 957334382c
Update LLVM configuration to define `HAVE_UNW_ADD_DYNAMIC_FDE` for macOS
since https://github.com/llvm/llvm-project/commit/957334382c moved that
to a define.

Differential Revision: https://reviews.llvm.org/D108157
2021-08-16 12:20:54 -07:00
Geoffrey Martin-Noble
668aa531d6 [Bazel] Update for dbed061bf1
This adds Bazel configuration for the TargetMCA targets, which currently
only includes AMDGPU.

Reviewed By: rnk

Differential Revision: https://reviews.llvm.org/D106996
2021-07-28 13:24:16 -07:00
Geoffrey Martin-Noble
8b86b3a846 [Bazel] Use bazel_skylib paths for paths munging
We do a lot of path munging and bazel_sklyib is a pretty reasonable dep.

Reviewed By: jpienaar

Differential Revision: https://reviews.llvm.org/D106175
2021-07-16 13:52:07 -07:00
Geoffrey Martin-Noble
4aeb2e60df Introduce a Bazel build configuration
This patch introduces configuration for a Bazel BUILD in a side
directory in the monorepo.

This is following the approval of
https://github.com/llvm/llvm-www/blob/main/proposals/LP0002-BazelBuildConfiguration.md

As detailed in the README, the Bazel BUILD is not supported
by the community in general, and is maintained only by interested
parties. It follows the requirements of the LLVM peripheral tier:
https://llvm.org/docs/SupportPolicy.html#peripheral-tier.

This is largely copied from https://github.com/google/llvm-bazel,
with a few filepath tweaks and the addition of the README.

Reviewed By: echristo, keith, dblaikie, kuhar

Differential Revision: https://reviews.llvm.org/D90352
2021-06-22 12:47:43 -07:00