Commit Graph

71 Commits

Author SHA1 Message Date
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
Jorge Gorbe Moya 54cc7de4bc Fix bazel build.
- https://reviews.llvm.org/D122619 bumped zlib version but didn't change
  the hash

- Added new header from https://reviews.llvm.org/D108438
2022-04-05 15:45:53 -07:00
Benjamin Kramer fe11344257 [bazel] Try to fix the build after 4661a65f4b 2022-04-05 14:40:52 +02:00
Mikhail Goncharov 567a979ea8 fix bazel build after 369337e3c2 2022-04-01 15:27:32 +02:00
Fangrui Song 8e9c7f716a [Bazel] Add BLAKE3 files to llvm:Support
Hope someone can figure out how to leverage SSE42/AVE2/Arm Neon.
2022-03-24 15:26:40 -07:00
Benjamin Kramer 9ed466e359 [bazel] glob LLVMCoroutines headers to make the build rule less fragile 2022-03-24 11:01:08 +01:00
Benjamin Kramer 38d248aadd [bazel] Set the default of LLVM_UNREACHABLE_OPTIMIZE to 1
This matches the CMake default. LLVM_UNREACHABLE_OPTIMIZE=0 doesn't
build with gcc
2022-03-24 10:56:43 +01:00
Benjamin Kramer 9816fada16 [bazel] Port a954ade8ed 2022-03-18 10:50:55 +01:00
Sterling Augustine 9065dd1439 Fix invalid preprocessor directive. 2022-03-17 19:12:48 -07:00
Sterling Augustine 6f958b6ff5 Update llvm-config.h.cmake for LLVM_UNREACHABLE_OPTIMIZE 2022-03-17 19:04:42 -07:00
Jakub Kuderski 7c285b78cf [bazel] Add build rule for llvm-remark-size-diff
This binary is used in LIT tests.

Test: `bazel run --config=generic_clang -c opt @llvm-project//llvm:llvm-remark-size-diff -- --help`

Reviewed By: dblaikie

Differential Revision: https://reviews.llvm.org/D121742
2022-03-16 14:07:07 -04:00
Benjamin Kramer 29fe819ed3 Revert "Update bazel build rules to match 169ebf03ab2a6f16bfa32a36305929c7bc8e4784."
This reverts commit f2af453263. The
corresponding LLVM change was reverted in 27712243ab.
2022-03-03 22:15:36 +01:00
Adrian Kuegel e7d65fca7e [Bazel] Fix build after ObjCopy move.
Differential Revision: https://reviews.llvm.org/D120039
2022-02-17 13:22:26 +01:00
Fangrui Song 633e797d59 [Bazel] Add WindowsDriver after 73e585e44d 2022-02-11 14:32:23 -08:00
Benjamin Kramer b9f1e1c36c [bazel] Port 216575e581 2022-02-08 23:01:04 +01:00
Benjamin Kramer 6fde1afecd [Debuginfod][Symbolizer] Cut dependency cycle after 4a6553f4c2 2022-02-08 21:53:30 +01:00
Benjamin Kramer fc604825ec [bazel] Port dbed14d215 2022-02-04 22:14:45 +01:00
Fangrui Song 85dfe19b36 [ModuleUtils] Move EmbedBufferInModule to LLVMTransformsUtils
D116542 adds EmbedBufferInModule which introduces a layer violation
(https://llvm.org/docs/CodingStandards.html#library-layering).
See 2d5f857a1e for detail.

EmbedBufferInModule does not use BitcodeWriter functionality and should be moved
LLVMTransformsUtils. While here, change the function case to the prevailing
convention.

It seems that EmbedBufferInModule just follows the steps of
EmbedBitcodeInModule. EmbedBitcodeInModule calls WriteBitcodeToFile but has IR
update operations which ideally should be refactored to another library.

Reviewed By: jhuber6

Differential Revision: https://reviews.llvm.org/D118666
2022-01-31 16:33:57 -08:00
Fangrui Song 2d5f857a1e [Bazel] Add include/llvm/Transforms/Utils/ModuleUtils.h to work around layer violation after D116542
There is a layer violation and can break clang -fmodule-name=X -fmodules-strict-decluse builds:

* LLVMTransformUtils has `#include "llvm/Bitcode/BitcodeWriterPass.h"`
* LLVMBitWriter depends on LLVMTransformUtils after D116542

Temporarily work around the issue.
2022-01-31 15:41:45 -08:00
Chuanqi Xu bbce75e352 Update Bug report URL to Github Issues
Although we moved to Github Issues. The bug report message refers to
Bugzilla still. This patch tries to update these URLs.

Reviewed By: MaskRay, Quuxplusone, jhenderson, libunwind, libc++

Differential Revision: https://reviews.llvm.org/D116351
2022-01-06 17:33:25 +08:00
Jakub Kuderski 5410152827 [Bazel] Add target for llvm-tli-checker
Reviewed By: vettoreldaniele, GMNGeoffrey

Differential Revision: https://reviews.llvm.org/D116222
2021-12-23 13:14:12 -05: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
Krasimir Georgiev eeed24e766 [Bazel] update build files for
65d7fd0239
2021-12-19 14:37:05 +01:00
Dmitri Gribenko fac18d7377 [Bazel] Add LLVM_BUILD_* variables to llvm-config.h to mirror ec37e0bbaf 2021-12-16 20:56:16 +01:00
Richard Smith f2af453263 Update bazel build rules to match 169ebf03ab. 2021-12-15 17:47:32 -08:00
Benjamin Kramer 12d42653b3 [bazel] Port debuginfod rules
Needed after 34491ca729
2021-12-14 13:14:30 +01:00
Mircea Trofin ce2a345265 [bazel] Exclude MLModelRunnerTest.cpp
Until we figure MLGO + bazel, exclude this unittest (same as
TFUtilsTest.cpp)

Differential Revision: https://reviews.llvm.org/D115472
2021-12-09 14:56:10 -08:00
David Blaikie 097a1cb1d5 Bazel: add new llvm-c/Deprecated.h header 2021-12-06 12:18:02 -08:00
Geoffrey Martin-Noble dc5e1d06b9 [Bazel] Set the right default for LLVM_WINDOWS_PREFER_FORWARD_SLASH on Windows
This cmake configure option was added in
df0ba47c36, and was ported to
Bazel in 7d323dc773.

However, the setting chosen in Bazel seems accidental, not necessarily
intentional.

LLVM_WINDOWS_PREFER_FORWARD_SLASH has no effect on Unix, and on
Windows, setting it to 0 is the default, which gets the same behaviour
as before. Setting it to 1 enables new experimental behaviours
(which is enabled by default on MinGW targets only).

As I don't see any explicit intent to opt in to the new experimental
behaviour, I believe the current configuration in bazel was a
mistake.

Differential Revision: https://reviews.llvm.org/D114065
2021-12-02 17:44:54 -08: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
Mircea Trofin ced5fd8dbf [bazel][mlgo] Remove the mlgo-related build excludes
They aren't needed anymore, we handle conditional compilation in those
files.

Reviewed By: GMNGeoffrey

Differential Revision: https://reviews.llvm.org/D114970
2021-12-02 09:51:03 -08:00
Tres Popp 2672094266 Extend timeout of llvm/unittests:ir_tests
This test became much slower after 01d8759ac9
2021-11-05 15:44:19 +01: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
Tres Popp d3224536fd Revert "Update bazel file after fe364e5dc78c58a915986d9a44cfd65f919a00c2"
This reverts commit 8af9912113.

The other relevant commit was reverted.
2021-11-02 18:03:10 +01:00
Tres Popp 8af9912113 Update bazel file after fe364e5dc7 2021-11-02 17:22:34 +01:00
Tres Popp bcad20bc65 [bazel] Update BUILD file for llvm-reduce
This is needed after fd41738e2c
2021-11-02 12:01:33 +01:00
Chandler Carruth 0198d76e1e [Bazel] Get `//clang` building on Windows with clang-cl.
This required substantially more invasive changes.

We need to handle some of the LLVM `config.h` changes differently from
the old pattern. These aren't always safe on the commandline, and the
Windows ones specifically break Clang. Instead, use conditional defines
in the header itself. This more closely matches how CMake builds see the
definitions. I think this is also just cleaner and we should maybe move
more of the macros out of Bazel.

The config defines for Windows that I've kept in Bazel are the ones that
LLVM's CMake does at the commandline as well. I've also added numerous
ones that CMake uses and we didn't replicate in Bazel.

I also needed a different approach to get `libclang` working well. This,
IMO, improves things on all platforms. Now we build the plugin and
actually wrap it back up with `cc_import`. We have to use a collection
of manually tagged `cc_binary` rules to get the naming to work out the
right way, but this isn't too different from the prior approach. By
directly having a `cc_binary` rule for each platform spelling of
`libclang`, we can actually extract the interface library from it and
correctly depend on it with `cc_import`. I think the result now is much
closer to the intent and to the CMake build for libclang.

Sadly, some tests also needed disabling. This is actually narrower than
what CMake does. The issue isn't indicative of anything serious -- the
test just assumes Unix-style paths.

I also have cleaned up the Windows flags in `.bazelrc` to much more
closely match what CMake does.

Differential Revision: https://reviews.llvm.org/D112399
2021-11-02 02:54:16 +00:00
Chandler Carruth 112dc16014 Add support for Bazel builds on Windows with `clang-cl`.
Adds basic `--config=clang-cl` to set up the basic options needed, and
then fix a number of issues that surface in Windows builds for me.

With these fixes, `//llvm/...` builds cleanly. One unittest still fails,
but its just due to running out of stack space due to creating a large
number of short-lived stack variables. The test should probably be
decomposed into a set of tests (`LegalizerInfoTest::RuleSets`), but that
seemed like too invasive of a change here and with everything building
cleanly this isn't disrupting me experimenting with Windows builds.

Some parts of `//clang/...` builds, but that will require more work.
2021-10-28 16:04:47 +00:00
William Muir 3e94833823 [Bazel] link backtrace library when building llvm/lib/Support under FreeBSD
Links the backtrace library which is required under FreeBSD when building llvm/lib/Support.  This library is similarly linked by CMake on BSD builds at [llvm/lib/Support/CMakeLists.txt](e158b5634a/llvm/lib/Support/CMakeLists.txt (L39-L46))

Reviewed By: GMNGeoffrey

Differential Revision: https://reviews.llvm.org/D110533
2021-10-26 14:24:02 -07:00
Adrian Kuegel 605efd5dd5 Fix bazel build.
This is a temporary fix, better would be to avoid including
llvm/Option/ArgList.h from a Support source file.

Differential Revision: https://reviews.llvm.org/D111974
2021-10-18 10:22:41 +02:00
Reid Kleckner aeeefe97c6 [bazel] Move MC header usage from Support to tblgen
After the TargetRegistry.h move, nothing in Support includes headers
from MC. However, files in tablegen use MC headers, so we must add an
entry for them in tblgen srcs.

Differential Revision: https://reviews.llvm.org/D111835
2021-10-14 13:53:09 -07: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
Krasimir Georgiev 8cb234e07d [Bazel] Fix for 6498b0e991 2021-09-27 10:44:58 +02:00
Dan F-M 33e1713a00 [Bazel] Add support for targeting macOS arm64
In attempting to build JAX on Apple Silicon, we discovered an issue with
the bazel configuration in llvm-project-overlay. This patch fixes the
logic, at least when building JAX. More context is included on the
following GitHub issue: https://github.com/google/jax/issues/5501

Differential Revision: https://reviews.llvm.org/D109839
2021-09-21 12:24:16 -07:00
William Muir 2aa8474210 [Bazel] Use posix definitions for FreeBSD
Presently, definitions default to those for Linux which are not defined for FreeBSD (HAVE_LSEEK64, HAVE_MALLINFO, etc.).  Patch sets os_defines to posix definitions under FreeBSD.

Reviewed By: GMNGeoffrey

Differential Revision: https://reviews.llvm.org/D109913
2021-09-16 13:57:49 -07:00
Geoffrey Martin-Noble 216d974a2f [Bazel] Fix Bazel config for 2c8e784915
Updates the Bazel config for OrcTargetProcess after
https://github.com/llvm/llvm-project/commit/2c8e784915

Differential Revision: https://reviews.llvm.org/D109731
2021-09-13 18:29:42 -07:00
Benjamin Kramer 1a88bd68c1 [Bazel] Add missing dependency after 650bbc5620 2021-09-05 21:14:05 +02:00
Geoffrey Martin-Noble 52acc0547d [Bazel] Fix version defines
Some of these were the wrong version and some of them were the wrong
format. Did some hunting around to figure out what exactly they're
supposed to be. Since basically everything is derived from the LLVM
version we should probably make this a bit less hardcoded, but just
fixing the values for now.

Sources:
https://github.com/llvm/llvm-project/blob/b686fc7a1bea/clang/include/clang/Basic/Version.inc.in
https://github.com/llvm/llvm-project/blob/b686fc7a1bea/clang/CMakeLists.txt#L353-L363
https://github.com/llvm/llvm-project/blob/b686fc7a1bea/llvm/CMakeLists.txt#L13-L29
https://github.com/llvm/llvm-project/blob/b686fc7a1bea/lld/CMakeLists.txt#L131-L138

Reviewed By: MaskRay

Differential Revision: https://reviews.llvm.org/D108500
2021-08-20 17:01:01 -07:00
Geoffrey Martin-Noble 2bd7c30e5a [Bazel] Reduce quote escaping
There's a lot of unnecessary backslashes here that we can avoid to
reduce confusion.

Reviewed By: MaskRay

Differential Revision: https://reviews.llvm.org/D108495
2021-08-20 16:33:10 -07:00