Commit Graph

313 Commits

Author SHA1 Message Date
Petr Hosek af21445ea8 [CMake][Fuchsia] Include find-all-symbols in the distribution
This is needed to use clang-include-fixer.

Differential Revision: https://reviews.llvm.org/D124053
2022-04-19 19:27:46 -07:00
Chris Bieneman b870620c29 [NFC] Add CMake cache file for HLSL
This just adds a trivial CMake cache file (which will grow over time)
to handle the common build configuration for the HLSL compiler.
2022-04-13 11:28:18 -05:00
Petr Hosek ff78d25b8e [CMake][Fuchsia] Include bolt
We would like to use bolt with Fuchsia toolchain.

Differential Revision: https://reviews.llvm.org/D123280
2022-04-06 22:48:17 -07:00
Petr Hosek abe997bb2d [CMake][Fuchsia] Switch to lld on Apple platforms
lld Mach-O backend supports all our use cases now.

Differential Revision: https://reviews.llvm.org/D122047
2022-03-22 01:06:30 -07:00
Vladimir Vereschaka 41f74bc7ae [CMake] Update cache file for Win to ARM Linux cross toolchain builders. NFC.
* fixed remote test script arguments for libc++/compiler-rt libraries.
* disabled shared libc++abi libraries (to let remote tests get passed).
2022-03-18 21:39:02 -07:00
Petr Hosek a014cb8650 [CMake][Fuchsia] Drop Darwin architectures
We want to build all available ones.

Differential Revision: https://reviews.llvm.org/D122022
2022-03-18 10:09:57 -07:00
Petr Hosek 0f9a855e7c [CMake][Fuchsia] Include llvm-undname
This is useful when developing on Windows.

Differential Revision: https://reviews.llvm.org/D122021
2022-03-18 10:09:13 -07:00
Petr Hosek 67f53708b2 Revert "[CMake][Fuchsia] Use correct architecture for iossim"
This reverts commit 1b6ff3f4f8 since
it broke Fuchsia's macOS builders.
2022-03-16 10:10:15 -07:00
Petr Hosek 1b6ff3f4f8 [CMake][Fuchsia] Use correct architecture for iossim
We should be building iossim for x86_64, not arm64.

Differential Revision: https://reviews.llvm.org/D121659
2022-03-14 19:21:09 -07:00
Vladimir Vereschaka d860ac5da6 [CMake] Replace `TARGET_TRIPLE` with `TOOLCHAIN_TARGET_TRIPLE` for Win-to-Arm cross toolchain cache file. NFC.
Avoid using TARGET_TRIPLE argument for the cross toolchain cmake cache file and replace it
with TOOLCHAIN_TARGET_TRIPLE.

Reference: https://reviews.llvm.org/D119918

Differential Revision: https://reviews.llvm.org/D121029
2022-03-04 16:39:28 -08:00
Vladimir Vereschaka 19c1b084a7 [CMake] Update cache file for Win to ARM cross tooolchain. NFC.
Removed passing CMAKE_AR from the library configurations.
2022-03-03 14:32:16 -08:00
Vladimir Vereschaka 18fa0b15cc [CMake] Use CMAKE_SYSROOT to build libs for Win to ARM cross tooolchain. NFC.
Provide CMAKE_SYSROOT for the libc++/libc++abi/libunwind libraries
instead of specific <foo>_SYSROOT for each of them.

Fixed passing some CMake arguments for the runtimes.

Referenced Differentials:
 * https://reviews.llvm.org/D119836
 * https://reviews.llvm.org/D112155
 * https://reviews.llvm.org/D111672

Differential Revision: https://reviews.llvm.org/D120383
2022-02-23 15:16:56 -08:00
Petr Hosek eec3488cf1 [CMake][Fuchsia] Disable assertions and analyzer for stage 1
We don't need these in the first stage compiler and disabling these
helps a bit with the compile time and runtime performance.

Differential Revision: https://reviews.llvm.org/D120280
2022-02-21 13:31:13 -08:00
Petr Hosek 792a4095c5 [CMake][Fuchsia] Only build iossim runtimes for arm64
x86_64 isn't supported with the recent Xcode SDK.
2022-01-27 02:28:13 -08:00
Petr Hosek 2fcdd685bd [CMake][Fuchsia] Drop 32-bit ios runtimes
These are no longer supported in the recent Xcode SDK versions.

Differential Revision: https://reviews.llvm.org/D118306
2022-01-26 18:57:21 -08:00
Petr Hosek c39d22d196 [CMake] Set sanitizer test C++ library on Linux
We always want to use the in-tree libc++ for tests.

Differential Revision: https://reviews.llvm.org/D118161
2022-01-25 11:09:48 -08:00
Petr Hosek fe0c5309c4 [Fuchsia] Remove i386 from iossim architectures
This is no longer supported in newer SDK versions.

Differential Revision: https://reviews.llvm.org/D118075
2022-01-24 14:48:47 -08:00
John Ericson 10d0d8c0c1 [clang][cmake] Use `GNUInstallDirs` to support custom installation dirs
I am breaking apart D99484 so the cause of build failures is easier to
understand.

Differential Revision: https://reviews.llvm.org/D117419
2022-01-21 23:58:08 +00:00
Alexandre Ganea aba5b91b69 Re-land [CodeView] Add full repro to LF_BUILDINFO record
This patch writes the full -cc1 command into the resulting .OBJ, like MSVC does. This allows for external tools (Recode, Live++) to rebuild a source file without any external dependency but the .OBJ itself (other than the compiler) and without knowledge of the build system.

The LF_BUILDINFO record stores a full path to the compiler, the PWD (CWD at program startup), a relative or absolute path to the source, and the full CC1 command line. The stored command line is self-standing (does not depend on the environment). In the same way, MSVC doesn't exactly store the provided command-line, but an expanded version (a somehow equivalent of CC1) which is also self-standing.

For more information see PR36198 and D43002.

Differential Revision: https://reviews.llvm.org/D80833
2022-01-19 19:44:37 -05:00
John Ericson da77db58d7 Revert "[cmake] Use `GNUInstallDirs` to support custom installation dirs."
https://lab.llvm.org/buildbot/#/builders/46/builds/21146 Still have
this odd error, not sure how to reproduce, so I will just try breaking
up my patch.

This reverts commit 4a678f8072.
2022-01-16 05:48:30 +00:00
John Ericson 4a678f8072 [cmake] Use `GNUInstallDirs` to support custom installation dirs.
This is the original patch in my GNUInstallDirs series, now last to merge as the final piece!

It arose as a new draft of D28234. I initially did the unorthodox thing of pushing to that when I wasn't the original author, but since I ended up

 - Using `GNUInstallDirs`, rather than mimicking it, as the original author was hesitant to do but others requested.

 - Converting all the packages, not just LLVM, effecting many more projects than LLVM itself.

I figured it was time to make a new revision.

I have used this patch series (and many back-ports) as the basis of https://github.com/NixOS/nixpkgs/pull/111487 for my distro (NixOS), which was merged last spring (2021). It looked like people were generally on board in D28234, but I make note of this here in case extra motivation is useful.

---

As pointed out in the original issue, a central tension is that LLVM already has some partial support for these sorts of things. Variables like `COMPILER_RT_INSTALL_PATH` have already been dealt with. Variables like `LLVM_LIBDIR_SUFFIX` however, will require further work, so that we may use `CMAKE_INSTALL_LIBDIR`.

These remaining items will be addressed in further patches. What is here is now rote and so we should get it out of the way before dealing more intricately with the remainder.

Reviewed By: #libunwind, #libc, #libc_abi, compnerd

Differential Revision: https://reviews.llvm.org/D99484
2022-01-16 05:33:07 +00:00
John Ericson 6e52bfe09d Revert "[cmake] Use `GNUInstallDirs` to support custom installation dirs."
Sorry for the disruption, I will try again later.

This reverts commit efeb501970.
2022-01-15 07:35:02 +00:00
John Ericson efeb501970 [cmake] Use `GNUInstallDirs` to support custom installation dirs.
This is the original patch in my GNUInstallDirs series, now last to merge as the final piece!

It arose as a new draft of D28234. I initially did the unorthodox thing of pushing to that when I wasn't the original author, but since I ended up

 - Using `GNUInstallDirs`, rather than mimicking it, as the original author was hesitant to do but others requested.

 - Converting all the packages, not just LLVM, effecting many more projects than LLVM itself.

I figured it was time to make a new revision.

I have used this patch series (and many back-ports) as the basis of https://github.com/NixOS/nixpkgs/pull/111487 for my distro (NixOS), which was merged last spring (2021). It looked like people were generally on board in D28234, but I make note of this here in case extra motivation is useful.

---

As pointed out in the original issue, a central tension is that LLVM already has some partial support for these sorts of things. Variables like `COMPILER_RT_INSTALL_PATH` have already been dealt with. Variables like `LLVM_LIBDIR_SUFFIX` however, will require further work, so that we may use `CMAKE_INSTALL_LIBDIR`.

These remaining items will be addressed in further patches. What is here is now rote and so we should get it out of the way before dealing more intricately with the remainder.

Reviewed By: #libunwind, #libc, #libc_abi, compnerd

Differential Revision: https://reviews.llvm.org/D99484
2022-01-15 01:08:35 +00:00
Andrzej Warzynski dfd9879d6f [Clang] Make Clang copy its CMake modules into the build dir
LLVM has a documented mechanism for passing configuration information to
an out of tree project using CMake. See
https://llvm.org/docs/CMake.html#embedding-llvm-in-your-project.
Similar logic applies to "standalone" builds of other sub-projects
within LLVM that depend on each other. For example, a standalone build
of Flang will use this mechanism to acquire Clang's configuration.

Currently, the relevant CMake modules for Clang will only be copied into
the installation directory. This means that in order to configure a
standalone build of Flang, one has to first build and then install
Clang. This is not required for LLVM nor for MLIR - other sub-projects
that Flang depends on (i.e. the CMake modules for LLVM and MLIR are
available in the build dir, so installation is not needed).

This change removes the need for installing Clang in order to access its
configuration. It makes sure that the required CMake modules are copied
into the build directory. This will make Clang behave consistently with
LLVM and MLIR in this respect. It will also simplify building Flang as
standalone sub-project.

Differential Revision: https://reviews.llvm.org/D116731
2022-01-12 09:51:14 +00:00
John Ericson 44e3365775 [CMake] Factor out config prefix finding logic
See the docs in the new function for details.

 I think I found every instance of this copy pasted code. Polly could
 also use it, but currently does something different, so I will save the
 behavior change for a future revision.

We get the shared, non-installed CMake modules following the pattern
established in D116472.

It might be good to have LLD and Flang also use this, but that would be
a functional change and so I leave it as future work.

Reviewed By: beanz, lebedev.ri

Differential Revision: https://reviews.llvm.org/D116521
2022-01-07 20:16:18 +00:00
Petr Hosek 8df26e7b4a [Fuchsia][CMake] Don't set libcxxabi and libunwind variables on Windows
We don't build libcxxabi and libunwind for Windows so don't set the
corresponding variables to avoid configuration errors.

Differential Revision: https://reviews.llvm.org/D113729
2021-11-11 19:29:39 -08:00
Vladimir Vereschaka efa5cadcf7 [CMake] Update Cmake cache file for Win to ARM Linux cross builds. NFC
Workaround to fix broken remote execution for the libunwind tests.

https://reviews.llvm.org/D112082
2021-10-29 18:55:49 -07:00
Ben Langmuir b8da594750 Reapply [ORC-RT] Configure the ORC runtime for more architectures and platforms
Reapply 5692ed0cce, but with the ORC runtime disabled explicitly on
CrossWinToARMLinux to match the other compiler-rt runtime libraries.

Differential Revision: https://reviews.llvm.org/D112229

---

Enable building the ORC runtime for 64-bit and 32-bit ARM architectures,
and for all Darwin embedded platforms (iOS, tvOS, and watchOS). This
covers building the cross-platform code, but does not add TLV runtime
support for the new architectures, which can be added independently.

Incidentally, stop building the Mach-O TLS support file unnecessarily on
other platforms.

Differential Revision: https://reviews.llvm.org/D112111
2021-10-21 09:00:18 -07:00
Petr Hosek ebcfd3ae8c [CMake] Include llvm-libtool-darwin in Fuchsia toolchain
We want to use this tool in our build.

Differential Revision: https://reviews.llvm.org/D111366
2021-10-07 16:44:40 -07:00
Leonard Chan 976aa4d759 Reland "[clang][Fuchsia] Re-enable compiler-rt tests in runtimes build"
This reverts commit a625fd26ce.

Round 3: The scudo test was addressed in
6727832c32.
2021-10-07 14:19:29 -07:00
Leonard Chan a625fd26ce Revert "Reland "[clang][Fuchsia] Re-enable compiler-rt tests in runtimes build""
This reverts commit c52d60ec3b.

The failing scudo test came up again.
2021-10-06 15:09:40 -07:00
Leonard Chan c7e72784ae [clang][Fuchsia] Add -static-libgcc to TSAN tests
This will ensure that tsan tests are built with the built libunwind.a
rather than the host libunwind.so.
2021-10-06 14:01:39 -07:00
Leonard Chan c52d60ec3b Reland "[clang][Fuchsia] Re-enable compiler-rt tests in runtimes build"
This reverts commit 95f824ad7c.

We should've addressed the remaining issues on our CI builders.
2021-10-06 13:57:24 -07:00
Leonard Chan 95f824ad7c Revert "[clang][Fuchsia] Re-enable compiler-rt tests in runtimes build"
This reverts commit 8480063f25.

We're seeing some test failures on our builders.
2021-10-04 16:11:43 -07:00
Leonard Chan 8480063f25 [clang][Fuchsia] Re-enable compiler-rt tests in runtimes build
Differential Revision: https://reviews.llvm.org/D110778
2021-10-04 14:11:49 -07:00
Nico Weber 9197834535 Revert "Fix CLANG_ENABLE_STATIC_ANALYZER=OFF building all analyzer source"
This reverts commit 6d7b3d6b3a.
Breaks running cmake with `-DCLANG_ENABLE_STATIC_ANALYZER=OFF`
without turning off CLANG_TIDY_ENABLE_STATIC_ANALYZER.
See comments on https://reviews.llvm.org/D109611 for details.
2021-09-20 16:18:03 -04:00
Alex Richardson 6d7b3d6b3a Fix CLANG_ENABLE_STATIC_ANALYZER=OFF building all analyzer source
Since https://reviews.llvm.org/D87118, the StaticAnalyzer directory is
added unconditionally. In theory this should not cause the static analyzer
sources to be built unless they are referenced by another target. However,
the clang-cpp target (defined in clang/tools/clang-shlib) uses the
CLANG_STATIC_LIBS global property to determine which libraries need to
be included. To solve this issue, this patch avoids adding libraries to
that property if EXCLUDE_FROM_ALL is set.

In case something like this comes up again: `cmake --graphviz=targets.dot`
is quite useful to see why a target is included as part of `ninja all`.

Reviewed By: thakis

Differential Revision: https://reviews.llvm.org/D109611
2021-09-20 12:55:56 +01:00
Leonard Chan 78f7ad5a83 [clang][Fuchsia] Remove COMPILER_RT_CAN_EXECUTE_TESTS
I forgot that we run `check-runtimes-x86_64-unknown-linux-gnu`, which
will run all compiler-rt tests also even though we are currently not in
a state where we can run them all yet. Remove this for now to fix our CI
builders.
2021-09-08 15:52:02 -07:00
Leonard Chan e5673564a0 [compiler-rt][Fuchsia] Support building + running compiler-rt tests on fuchsia's host toolchain
Differential Revision: https://reviews.llvm.org/D109199
2021-09-08 11:32:11 -07:00
Fangrui Song a42bd1b560 [CMake] Change -DENABLE_EXPERIMENTAL_NEW_PASS_MANAGER=off to -DLLVM_ENABLE_NEW_PASS_MANAGER=off
LLVM_ENABLE_NEW_PASS_MANAGER is set to ENABLE_EXPERIMENTAL_NEW_PASS_MANAGER, so
-DLLVM_ENABLE_NEW_PASS_MANAGER=off has no effect.

Change the cache variable to LLVM_ENABLE_NEW_PASS_MANAGER instead.
A user opting out the new PM needs to switch from
-DENABLE_EXPERIMENTAL_NEW_PASS_MANAGER=off to
-DLLVM_ENABLE_NEW_PASS_MANAGER=off.

Also give a warning that -DLLVM_ENABLE_NEW_PASS_MANAGER=off is deprecated.

Reviewed By: aeubanks, phosek

Differential Revision: https://reviews.llvm.org/D108775
2021-08-26 14:25:31 -07:00
Leonard Chan e2ff880a7e [clang][cache] Update Fuchsia-stage2.cmake to create hwasan multilibs
This is a reland of commit a9d1970384.

Differential Revision: https://reviews.llvm.org/D99364
2021-08-10 10:52:24 -07:00
Petr Hosek a9d1970384 Revert "[clang][cache] Update Fuchsia-stage2.cmake to create hwasan multilibs"
This reverts commit bb438f6cbf since
it broke our Windows builders and we need more time to investigate
the issue.
2021-07-30 18:56:51 -07:00
Leonard Chan bb438f6cbf [clang][cache] Update Fuchsia-stage2.cmake to create hwasan multilibs
Differential Revision: https://reviews.llvm.org/D99364
2021-07-30 11:53:21 -07:00
Haowei Wu 6103fdfab4 [ifs][elfabi] Merge llvm-ifs/elfabi tools
This change merges llvm-elfabi and llvm-ifs tools.

Differential Revision: https://reviews.llvm.org/D100139
2021-07-19 11:23:19 -07:00
Leonard Chan 9b0ddc2662 [clang][Fuchsia] Remove relative-vtables multilibs
As of D102374, relative vtables is enabled on Fuchsia by default, so we don't need any of the RV multilibs.

Differential revision: https://reviews.llvm.org/D105145
2021-06-30 11:21:37 -07:00
Daniel Hwang d9cf8291e7 Create install targets for scan-build-py.
A new revision identical to https://reviews.llvm.org/D101139
The parent revision of aforementioned revision seems to cause pre-merge checks to fail opaquely. Seeing if creating a new revision will work.

Reviewed By: phosek

Differential Revision: https://reviews.llvm.org/D104138
2021-06-21 13:08:34 -07:00
Petr Hosek 0d5af7a4ca Revert "[CMake] Don't use libc++ by default on Windows yet"
This reverts commit b413e44200.
2021-06-11 00:45:49 -07:00
Petr Hosek b413e44200 [CMake] Don't use libc++ by default on Windows yet
libc++ has issues when used with -fno-exceptions and vcruntime,
don't use it on Windows by default until we address those issues.

Differential Revision: https://reviews.llvm.org/D103941
2021-06-08 23:57:14 -07:00
Petr Hosek 1683dbf0dd [CMake][Fuchsia] Disable vcruntime for first stage as well
Using vcruntime is breaking libc++ headers so don't use it.

Differential Revision: https://reviews.llvm.org/D103926
2021-06-08 13:44:24 -07:00
Petr Hosek a7142f5c91 Partially revert the Fuchsia changes to avoid the use of PIC
This reverts commit:
2a5afb4665
de98da2ece
1dba2a0269
2021-06-08 13:03:26 -07:00