470 Commits

Author SHA1 Message Date
Sirraide
c4a019747c
[Clang] Remove ARCMigrate (#119269)
In the discussion around #116792, @rjmccall mentioned that ARCMigrate
has been obsoleted and that we could go ahead and remove it from Clang,
so this patch does just that.
2025-01-30 05:32:25 +01:00
Akira Hatanaka
60927405f5
Don't use CLANG_VERSION_MAJOR to check that the value passed to -fclang-abi-compat= is valid (#123998)
Use LLVM_VERSION_MAJOR instead as the maximum allowed value. This change
is needed to fix regression tests that fail when vendors set
CLANG_VERSION_MAJOR to a value that is lower than LLVM_VERSION_MAJOR
when building the compiler.

For example, clang/test/CodeGenCXX/mangle-concept.cpp fails with the
following error if -DCLANG_VERSION_MAJOR=17 is passed to cmake:

invalid value '19' in '-fclang-abi-compat=19'
2025-01-28 18:59:05 -08:00
Tom Stellard
1a53d4baeb
[clang][cmake] Apply bolt optimizations as part of the clang target (#119896)
This change removes the need to call the clang-bolt target in order to
apply bolt optimizations to clang. Now running `ninja clang` will build
a clang with bolt optimizations, and `ninja check-clang` and `ninja
install-clang` will test and install bolt optimized clang too.

The clang-bolt target has been kept for compatibilty reasons, but it is
now just an alias to the clang target.

Also, this new design for applying the bolt optimizations to clang will
be easier to generalize and use to optimize other binaries/libraries in
the project.

---------

Co-authored-by: Amir Ayupov <fads93@gmail.com>
Co-authored-by: Petr Hosek <phosek@google.com>
2025-01-25 03:59:45 -08:00
paperchalice
b07e7b76c5
[cmake] Drop AddFileDependencies and CMakeParseArguments (#120002)
Theses modules are deprecated and have trivial implementations in modern
cmake.
2024-12-17 19:24:32 +08:00
Amir Ayupov
d61b2590f8 [Clang-BOLT] Drop CDSplit flag
Breaks AArch64 Clang-BOLT builds:
https://github.com/llvm/llvm-project/pull/109351#issuecomment-2368584365
2024-09-23 08:15:05 -07:00
Amir Ayupov
bbca451be0
[CMake] Preserve clang-prebolt
In Clang-BOLT step, preserve pre-BOLT Clang binary (as well as clang++
symlink).

Also modify the default set of BOLT flags:
- drop ICF (can mess with unwinders),
- switch from hfsort+ to cdsort (aliases),
- enable CDSplit,
- update debug sections.

Reviewers: maksfb

Reviewed By: maksfb

Pull Request: https://github.com/llvm/llvm-project/pull/109351
2024-09-21 20:56:21 -07:00
Martin Storsjö
41c650e820
[clang] Don't use -Wno-nested-anon-types on GCC (#95029)
GCC usually doesn't warn about unrecognized -Wno-<foo> options, if no
diagnostics are printed. However if some diagnostics are printed, it
also mentions that there were unrecognized -Wno-<foo> options.

Before 4feae05c6abda364a9295aecfa600d7d4e7dfeb6, we checked for whether
-Wnested-anon-types was supported, and added the -Wno-<foo> form if the
positive form of the option was supported.

As of GCC 14, -Wnested-anon-types isn't supported, thus limit the use of
the option to actual Clang (and still only while using the GCC
compatible driver).

This avoids unnecessary mentions about unrecognized -Wno-<foo> options
when building with GCC.
2024-06-11 09:03:41 +03:00
Tom Stellard
be06761545
[clang][cmake] Fixes for PGO builds when invoking ninja twice (#92591)
This fixes two problems with the 2-stage PGO builds. The first problem
was that the stage2-instrumented and stage2 targets would not be built
on the second ninja invocation. For example:

This would work as expected.
$ ninja -v -C build stage2-instrumented-generate-profdata

Edit a file.
$ touch llvm/lib/Support/StringExtras.cpp

This would rebuild stage1 only and not build stage2-instrumented or
regenerate the profile data.
$ ninja -v -C build stage2-instrumented-generate-profdata

The second problem was that in some cases, the profile data would be
regenerated, but not all of the stage2 targets would be rebuilt. One
common scenario where this would happen is:

This would work as expected.
$ ninja -C build stage2-check-all

This would regenerate the profile data, but then only build the
targets that were needed for install, but weren't needed for
check-all.  This would cause errors like:
ld.lld: error: Function Import: link error: linking module flags
'ProfileSummary': IDs have conflicting values in ...
 This is because the executibles being built for the install target
used the new profile data, but they were linking with libraries that
used the old profile data.
$ ninja -C build stage2-install

With this change we can re-enable PGO for the release builds.
2024-06-10 13:01:58 -07:00
Michael Kruse
f2a385c74a
[clang] Revise IDE folder structure (#89743)
Update the folder titles for targets in the monorepository that have not
seen taken care of for some time. These are the folders that targets are
organized in Visual Studio and XCode (`set_property(TARGET <target>
PROPERTY FOLDER "<title>")`) when using the respective CMake's IDE
generator.

 * Ensure that every target is in a folder
 * Use a folder hierarchy with each LLVM subproject as a top-level folder
 * Use consistent folder names between subprojects
 * When using target-creating functions from AddLLVM.cmake, automatically
deduce the folder. This reduces the number of
`set_property`/`set_target_property`, but are still necessary when
`add_custom_target`, `add_executable`, `add_library`, etc. are used. A
LLVM_SUBPROJECT_TITLE definition is used for that in each subproject's
root CMakeLists.txt.
2024-05-25 17:16:39 +02:00
Vlad Serebrennikov
4feae05c6a
Remove some try_compile CMake checks for compiler flags (#92953)
This patch remove 36 checks for compiler flags that are done via
invoking the compiler across LLVM, Clang, and LLDB. It's was made
possible by raising the bar for supported compilers that has been
happening over the years since the checks were added.

This is going to improve CMake configuration times. This topic was
highlighted in
https://discourse.llvm.org/t/cmake-compiler-flag-checks-are-really-slow-ideas-to-speed-them-up/78882.
2024-05-23 17:05:41 +04:00
Matthias Braun
2868e26d0a
Use cmake to find perl executable (#91275)
`clang/tools/scan-build` is implemented in `perl`. However given `perl`
is not mentioned as a required dependency in `GettingStarted.rst` we
should make this optional.

This adds a `find_package(Perl)` check to cmake and disables the
`scan-build` tests when no perl executable is found.

Ideally we would also check if dependent perl modules like `Hash::Util`
are present on the system, but I don't see any pre-existing cmake macros
to easily test this. So for now I go with a plain check for the `perl`
package, at least this allows to use `cmake
-DCMAKE_DISABLE_FIND_PACKAGE_Perl=ON` to manually disable `perl` and the
tests.
2024-05-08 07:35:47 -07:00
Nathan Lanza
10661ba240
[CIR][NFC] Add scaffolding for the CIR dialect and CIROps.td
This adds no real content, it just incrementally adds some scaffolding
necessary to enable a future patch to just add our first few ops.

Test Plan:
```
$ cmake -Sllvm -Bbuild -DCLANG_ENABLE_CIR=1 \
  -DLLVM_ENABLE_PROJECTS='clang;mlir' \
  -DCMAKE_BUILD_TYPE=Release -GNinja
$ ninja -C build check-clang
$ ninja -C build MLIRCIROpsIncGen
$ ninja -C build MLIRCIR
```

Reviewers: AaronBallman, erichkeane, bcardosolopes

Reviewed By: erichkeane, AaronBallman, bcardosolopes

Pull Request: https://github.com/llvm/llvm-project/pull/86080
2024-04-24 22:26:40 -04:00
Nathan Lanza
44de2bb694
[CIR][cmake] Add support for cmake variable CLANG_ENABLE_CIR
Introduce a cmake variable that guards the inclusion of ClangIR into the
build of clang. Guard that we aren't trying to build without MLIR. Add
two subdirectories that, as of now, don't do anything.

Reviewers: bcardosolopes, erichkeane, petrhosek, Ericson2314

Reviewed By: bcardosolopes

Pull Request: https://github.com/llvm/llvm-project/pull/86078
2024-04-11 16:56:31 -04:00
Michał Górny
e14c6fa31a
[clang] [cmake] Add cmake module dir before using GetDarwinLinkerVersion (#86386)
Move the code adding top-level cmake/Modules directory to
CMAKE_MODULE_PATH prior to including `GetDarwinLinkerVersion`, in order
to fix standalone builds.

Fixes a regression introduced by
3bc71c2abfa00413fd15cf0e5c08af6ec0d4768b.
2024-03-23 19:26:20 +00:00
Usama Hameed
3bc71c2abf
Get the linker version and pass the it to compiler-rt tests on Darwin. (#86220)
The HOST_LINK_VERSION is a hardcoded string in Darwin clang that detects
the linker version at configure time. The driver uses this information
to build the correct set of arguments for the linker. This patch detects
the linker version again during compiler-rt configuration and passes it
to the tests. This allows a clang built on a machine with a new linker
to run compiler-rt tests on a machine with an old linker.

rdar://125198603
2024-03-22 15:29:36 -07:00
Fangrui Song
d59730d706
[CMake] Change GCC_INSTALL_PREFIX from warning to fatal error (#85891)
unless USE_DEPRECATED_GCC_INSTALL_PREFIX (temporary escape hatch) is
set. Setting GCC_INSTALL_PREFIX leads to a warning for Clang 18.1
(#77537) and will be completely removed for Clang 20.

Link:
discourse.llvm.org/t/add-gcc-install-dir-deprecate-gcc-toolchain-and-remove-gcc-install-prefix/65091
Link:
discourse.llvm.org/t/correct-cmake-parameters-for-building-clang-and-lld-for-riscv/72833
2024-03-20 22:45:38 -07:00
Amir Ayupov
5a5ce012e4 Reland [Clang][CMake] Support perf, LBR, and Instrument CLANG_BOLT options (#69133)
This reverts commit 6953b367027e4234607a6718a0a1d57eb52ef57e.

Couldn't reproduce cmake issues from any of the affected buildbots:
https://lab.llvm.org/buildbot/#/builders/139/builds/57628
https://lab.llvm.org/buildbot/#/builders/163/builds/50270
https://lab.llvm.org/buildbot/#/builders/223/builds/34823
https://lab.llvm.org/buildbot/#/builders/225/builds/29950
https://lab.llvm.org/buildbot/#/builders/245/builds/19468

A common trait is that these builders don't clean build directory.
Push again and monitor these builders.
2024-01-27 19:01:40 -08:00
Amir Ayupov
6953b36702 Revert "Reland [Clang][CMake] Support perf, LBR, and Instrument CLANG_BOLT options (#69133)"
This reverts commit b83b8d3fd17885438b0ea154e07088d877d293a8.

Breaks buildbots e.g.
https://lab.llvm.org/buildbot/#/builders/225/builds/29950
2024-01-22 14:56:43 -08:00
Amir Ayupov
b83b8d3fd1 Reland [Clang][CMake] Support perf, LBR, and Instrument CLANG_BOLT options (#69133)
This reverts commit 6c47419703acfcd7dcca9e30ab9dba6a7a42f977.

Default to CLANG_BOLT=OFF

Test Plan:
Build a regular Clang build.
2024-01-22 14:47:42 -08:00
David Spickett
6c47419703 Revert "[Clang][CMake] Support perf, LBR, and Instrument CLANG_BOLT options (#69133)"
This reverts commit 745883bba69007f1d2c5135f3d5b0f1efcfc82cd.

This is failing to configure on many of our bots:
https://lab.llvm.org/buildbot/#/builders/245/builds/19468

This did not get caught right away because generally bots only
clean the build every so often.
2024-01-22 08:58:17 +00:00
Amir Ayupov
745883bba6
[Clang][CMake] Support perf, LBR, and Instrument CLANG_BOLT options (#69133)
Split up and refactor CLANG_BOLT_INSTRUMENT into support for
BOLT instrumentation, perf no-LBR and perf with LBR profiling.

Differential Revision: https://reviews.llvm.org/D143617
2024-01-21 22:03:39 -08:00
Fangrui Song
3358c77b01
[CMake] Deprecate GCC_INSTALL_PREFIX (#77537)
Part of https://reviews.llvm.org/D158218

GCC_INSTALL_PREFIX is a rarely-used legacy option inherited from
pre-CMake build system and has configuration file replacement nowadays.
Many `clang/test/Driver` tests specify `--gcc-toolchain=` to prevent
failures when `GCC_INSTALL_PREFIX` is specified: some contributors add
them to fix tests and some just do cargo culting. This is not healthy
for contributors adding cross compilation support for this rarely used
option.

`DEFAULT_SYSROOT` should in spirit be deprecated as well, but a relative
path doesn't have good replacement, so don't deprecate it for now.

Link:
https://discourse.llvm.org/t/add-gcc-install-dir-deprecate-gcc-toolchain-and-remove-gcc-install-prefix/65091
Link:
https://discourse.llvm.org/t/correct-cmake-parameters-for-building-clang-and-lld-for-riscv/72833

---

With `GCC_INSTALL_PREFIX=/usr`, `clang a.c` behaves like
`clang --gcc-toolchain=/usr a.c`.

Here is a simplified version of GCC installation detection code.
```
if (OPT_gcc_install_dir_EQ)
  return OPT_gcc_install_dir_EQ;

if (OPT_gcc_triple)
  candidate_gcc_triples = {OPT_gcc_triple};
else
  candidate_gcc_triples = collectCandidateTriples();
if (OPT_gcc_toolchain)
  prefixes = {OPT_gcc_toolchain};
else
  prefixes = {OPT_sysroot/usr, OPT_sysroot};
for (prefix : prefixes)
  if "$prefix/lib/gcc" exists // also tries $prefix/lib/gcc-cross
    for (triple : candidate_gcc_triples)
      if "$prefix/lib/gcc/$triple" exists
        return "$prefix/lib/gcc/$triple/$version"; // pick the largest version
```

`--gcc-toolchain=` specifies a directory where
`lib/gcc{,-cross}/$triple/$version` can be found. If you actually want
to use a specific version of GCC, specify something like
`--gcc-install-dir=/usr/lib/gcc/x86_64-linux-gnu/11` in a configuration
file. You can also specify `--gcc-triple=`.

On Debian and its derivatives where the target triple omits the vendor
part, the following ways are roughly equivalent, except that
`--gcc-install-dir=` specifies a version as well:
```
clang --gcc-toolchain=/usr a.c
clang --gcc-install-dir=/usr/lib/gcc/x86_64-linux-gnu/11 a.c
clang --gcc-triple=x86_64-linux-gnu a.c
```
2024-01-10 11:01:55 -08:00
Abhina Sree
d430c145ba
[CMake] Move check for dlfcn.h and dladdr to clang (#76163)
This patch checks for the presence of dlfcn.h and dladdr in clang to be used in clang/tools/libclang/CIndexer.cpp
2023-12-22 08:12:19 -05:00
James Y Knight
31aebdd891
Include LLVM_VERSION_SUFFIX in the Clang version string. (#74469)
This causes current mainline to now report "18.0.0git" instead of
"18.0.0".

Fixes #53825
2023-12-05 12:20:12 -05:00
Jon Roelofs
2fb1c1082c
cmake: add missing dependencies on ClangDriverOptions tablegen
The modules build trips over this frequently because there is no textual
include of the tablegen output, but the module includes it.

Differential revision: https://reviews.llvm.org/D157119
2023-08-04 10:27:19 -07:00
Petr Hosek
96962d5512 [clang] set python3 as required build dependency
The required HTMLLogger include file needs python3 to run
resource_bundle.py to bundle all the html/css/js resources. However, if
user sets -DLLVM_INCLUDE_TESTS=OFF, CMake will not find python3 and the
resource bundler will never be executed. This patch set the python3 as a
required build dependency to fix this problem.

Patch By: Avimitin

Differential Revision: https://reviews.llvm.org/D152418
2023-06-09 07:52:48 +00:00
Mark de Wever
cbaa3597aa Reland "[CMake] Bumps minimum version to 3.20.0.
This reverts commit d763c6e5e2d0a6b34097aa7dabca31e9aff9b0b6.

Adds the patch by @hans from
https://github.com/llvm/llvm-project/issues/62719
This patch fixes the Windows build.

d763c6e5e2d0a6b34097aa7dabca31e9aff9b0b6 reverted the reviews

D144509 [CMake] Bumps minimum version to 3.20.0.

This partly undoes D137724.

This change has been discussed on discourse
https://discourse.llvm.org/t/rfc-upgrading-llvms-minimum-required-cmake-version/66193

Note this does not remove work-arounds for older CMake versions, that
will be done in followup patches.

D150532 [OpenMP] Compile assembly files as ASM, not C

Since CMake 3.20, CMake explicitly passes "-x c" (or equivalent)
when compiling a file which has been set as having the language
C. This behaviour change only takes place if "cmake_minimum_required"
is set to 3.20 or newer, or if the policy CMP0119 is set to new.

Attempting to compile assembly files with "-x c" fails, however
this is workarounded in many cases, as OpenMP overrides this with
"-x assembler-with-cpp", however this is only added for non-Windows
targets.

Thus, after increasing cmake_minimum_required to 3.20, this breaks
compiling the GNU assembly for Windows targets; the GNU assembly is
used for ARM and AArch64 Windows targets when building with Clang.
This patch unbreaks that.

D150688 [cmake] Set CMP0091 to fix Windows builds after the cmake_minimum_required bump

The build uses other mechanism to select the runtime.

Fixes #62719

Reviewed By: #libc, Mordante

Differential Revision: https://reviews.llvm.org/D151344
2023-05-27 12:51:21 +02:00
Nico Weber
d763c6e5e2 Revert "Reland "[CMake] Bumps minimum version to 3.20.0.""
This reverts commit 65429b9af6a2c99d340ab2dcddd41dab201f399c.

Broke several projects, see https://reviews.llvm.org/D144509#4347562 onwards.

Also reverts follow-up commit "[OpenMP] Compile assembly files as ASM, not C"

This reverts commit 4072c8aee4c89c4457f4f30d01dc9bb4dfa52559.

Also reverts fix attempt  "[cmake] Set CMP0091 to fix Windows builds after the cmake_minimum_required bump"

This reverts commit 7d47dac5f828efd1d378ba44a97559114f00fb64.
2023-05-17 10:53:33 -04:00
Jonas Hahnfeld
0b3c48d572 [cmake] Correct option to LLVM_FORCE_USE_OLD_TOOLCHAIN
This option was renamed a long time ago in commit 388cefa78d.
2023-05-17 10:35:49 +02:00
Amir Ayupov
76b2915fdb [Clang][CMake] Use perf-training for Clang-BOLT
Leverage perf-training flow for BOLT profile collection, enabling reproducible
BOLT optimization. Remove the use of bootstrapped build for profile collection.

Test Plan:
- Regular (single-stage) build
```
$ cmake ... -C .../clang/cmake/caches/BOLT.cmake
$ ninja clang-bolt
...
[21/24] Instrumenting clang binary with BOLT
[21/24] Generating BOLT profile for Clang
[23/24] Merging BOLT fdata
Profile from 2 files merged.
[24/24] Optimizing Clang with BOLT
...
          1291202496 : executed instructions (-1.1%)
            27005133 : taken branches (-71.5%)
...
```
- Two stage build (ThinLTO+InstPGO)
```
$ cmake ... -C .../clang/cmake/caches/BOLT.cmake -C .../clang/cmake/caches/BOLT-PGO.cmake
$ ninja clang-bolt
$ ninja stage2-clang-bolt
...
[2756/2759] Instrumenting clang binary with BOLT
[2756/2759] Generating BOLT profile for Clang
[2758/2759] Merging BOLT fdata
[2759/2759] Optimizing Clang with BOLT
...
BOLT-INFO: 7092 out of 184104 functions in the binary (3.9%) have non-empty execution profile
           756531927 : executed instructions (-0.5%)
            15399400 : taken branches (-40.3%)
...
```

Reviewed By: beanz

Differential Revision: https://reviews.llvm.org/D143553
2023-05-13 10:36:29 -07:00
Mark de Wever
65429b9af6 Reland "[CMake] Bumps minimum version to 3.20.0."
The owner of the last two failing buildbots updated CMake.

This reverts commit e8e8707b4aa6e4cc04c0cffb2de01d2de71165fc.
2023-05-13 11:42:25 +02:00
Mark de Wever
e8e8707b4a Revert "Reland "[CMake] Bumps minimum version to 3.20.0.""
Unfortunatly not all buildbots are updated.

This reverts commit ffb807ab5375b3f78df198dc5d4302b3b552242f.
2023-05-06 17:03:56 +02:00
Mark de Wever
ffb807ab53 Reland "[CMake] Bumps minimum version to 3.20.0."
All build bots should be updated now.

This reverts commit 44d38022ab29a3156349602733b3459df5beef93.
2023-05-06 11:43:02 +02:00
Haowei Wu
e38cdc5933 Disable compiler launcher on external projects and multi stage clang
When using compiler caching program like ccache, there is no point to
use them on external projects or multi-stage clang builds. As these
builds uses fresh from source code toolchain and will pollute the build
cache. If a compiler launcher is still required, a user can explicity
define `CMAKE_C_COMPILER_LAUNCHER` and `CMAKE_CXX_COMPILER_LAUNCHER` in
`CLANG_BOOTSTRAP_PASSTHROUGH` and `LLVM_EXTERNAL_PROJECT_PASSTHROUGH`
flags to enable compiler launcher in these builds.

Differential Revision: https://reviews.llvm.org/D144603
2023-04-24 12:15:44 -07:00
Igor Kudrin
43c307fd69 [CMake] Add llvm-lib to Clang bootstrap dependency for LTO builds on Windows
Without this dependency, it is possible that llvm-lib.exe will not be
built, in which case CMake will try to use lib.exe to build libraries,
but this tool cannot handle bitcode files.

Differential Revision: https://reviews.llvm.org/D148751
2023-04-20 17:02:17 -07:00
Vitaly Buka
3fb4d45866 Revert "[cmake] Explicitly disable download step"
This does not help. The build is broken because compiler-rt-clear
deletes cmake generated files in STAMP_DIR/

This reverts commit da89ed99a16920e5986b14853d297322ccf7109e.
2023-04-19 15:14:35 -07:00
Vitaly Buka
da89ed99a1 [cmake] Explicitly disable download step
Fixes the following on cmake version 3.24.2:
'tools/clang/runtime/compiler-rt-stamps/compiler-rt-source_dirinfo.txt',
needed by 'tools/clang/runtime/compiler-rt-stamps/compiler-rt-download',
missing and no known rule to make it

Maybe related to https://cmake.org/cmake/help/latest/release/3.24.html#modules
2023-04-19 12:57:12 -07:00
Mark de Wever
44d38022ab Revert "Revert "Revert "[CMake] Bumps minimum version to 3.20.0."""
This reverts commit 1ef4c3c859728008cf707cad8d67f45ae5070ae1.

Two buildbots still haven't been updated.
2023-04-15 20:12:24 +02:00
Mark de Wever
1ef4c3c859 Revert "Revert "[CMake] Bumps minimum version to 3.20.0.""
This reverts commit 92523a35a827539db8557bbc3ecab7f9ea3f6ade.

Reland to see whether CIs are updated.
2023-04-15 13:12:04 +02:00
Mark de Wever
d0398d3593 Revert "Reland "[CMake] Bumps minimum version to 3.20.0.""
This reverts commit a72165e5df59032cdd54dcb18155f2630d73abd1.

Some buildbots have not been updated yet.
2023-03-18 20:32:43 +01:00
Mark de Wever
a72165e5df Reland "[CMake] Bumps minimum version to 3.20.0."
This reverts commit 92523a35a827539db8557bbc3ecab7f9ea3f6ade.

Test whether all CI runners are updated.
2023-03-18 13:33:42 +01:00
Tom Stellard
8216910395 clang/cmake: Use installed gtest libraries for stand-alone builds
(re-commit of cb38df4c4d3aee53107219a68749dc94fe70ff68 with the correct commit message)

Reviewed By: phosek, kwk

Differential Revision: https://reviews.llvm.org/D138472
2023-03-10 20:00:23 -08:00
Tom Stellard
e99ccd8d03 Revert "Add install targets for gtest"
This reverts commit cb38df4c4d3aee53107219a68749dc94fe70ff68.

I accidentally committed this with the wrong commit message.
2023-03-10 19:59:20 -08:00
Tom Stellard
cb38df4c4d Add install targets for gtest
Stand-alone builds need an installed version of gtest in order to run
the unittests.

Reviewed By: mgorny, kwk

Differential Revision: https://reviews.llvm.org/D137890
2023-03-10 19:43:07 -08:00
Mark de Wever
92523a35a8 Revert "[CMake] Bumps minimum version to 3.20.0."
Some build bots have not been updated to the new minimal CMake version.
Reverting for now and ping the buildbot owners.

This reverts commit 44c6b905f8527635e49bb3ea97dea315f92d38ec.
2023-03-04 18:28:13 +01:00
Mark de Wever
44c6b905f8 [CMake] Bumps minimum version to 3.20.0.
This partly undoes D137724.

This change has been discussed on discourse
https://discourse.llvm.org/t/rfc-upgrading-llvms-minimum-required-cmake-version/66193

Note this does not remove work-arounds for older CMake versions, that
will be done in followup patches.

Reviewed By: mehdi_amini, MaskRay, ChuanqiXu, to268, thieta, tschuett, phosek, #libunwind, #libc_vendors, #libc, #libc_abi, sivachandra, philnik, zibi

Differential Revision: https://reviews.llvm.org/D144509
2023-03-04 12:40:57 +01:00
Haowei Wu
dc1c8917af [Clang] Add llvm-mt and llvm-rc to Clang bootstrap dependency
This patch adds llvm-mt and llvm-rc to the Clang bootstrap
dependency when building the Clang under Windows.

Differential Revision: https://reviews.llvm.org/D143025
2023-02-06 11:36:27 -08:00
Amir Ayupov
e67f849001 [CMake] Replace clang binary if using clang-bolt target
Instead of creating an extra clang-bolt binary and clang++-bolt symlink,
replace the original clang binary with BOLT-optimized one.

This fixes the issue with installing optimized binary as `install-clang`
target now copies the new version.

Reviewed By: phosek

Differential Revision: https://reviews.llvm.org/D139454
2023-01-28 11:54:09 -08:00
Joseph Huber
d1f4bfd2a8 [Clang] Remove CLANG_OPENMP_NVPTX_DEFAULT_ARCH CMake option.
The `CLANG_OPENMP_NVPTX_DEFAULT_ARCH` is a static build configuration to
set the default OpenMP value. This was replaced in D141708 with the use
of the `nvptx-arch` tool which lets us query this at runtime instead.
This makes the behaviour between AMD and NVIDIA be more consisten and
allows users to have a default architecture that does not rely on
whoever configured the LLVM build.

Depends on D141708

Reviewed By: tra, MaskRay

Differential Revision: https://reviews.llvm.org/D141723
2023-01-13 16:52:07 -06:00
Mark de Wever
d40dc41738 [CMake] Warn when the version is older than 3.20.0.
This is a preparation to require CMake 3.20.0 after LLVM 16 has been
released.

This change has been discussed on discourse
https://discourse.llvm.org/t/rfc-upgrading-llvms-minimum-required-cmake-version/66193

Reviewed By: #libc_vendors, MaskRay, ChuanqiXu, to268, thieta, stellaraccident, ldionne, #libc, #libc_abi, phosek

Differential Revision: https://reviews.llvm.org/D137724
2022-12-11 20:19:46 +01:00