Commit Graph

285 Commits

Author SHA1 Message Date
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
Petr Hosek 2a5afb4665 [CMake][Fuchsia] Use PIC for Fuchsia runtimes
Disabling PIC globally also disabled PIC for runtimes which was
undesirable, manually override it.

Differential Revision: https://reviews.llvm.org/D103919
2021-06-08 12:30:27 -07:00
Petr Hosek f673365e1c [CMake][Fuchsia] Include llvm-otool in Fuchsia toolchain
We want to use llvm-otool in our build.

Differential Revision: https://reviews.llvm.org/D103918
2021-06-08 11:25:17 -07:00
Petr Hosek de98da2ece [CMake] Only include LTO on Apple targets
We only need libLTO when using ld64.

Differential Revision: https://reviews.llvm.org/D103916
2021-06-08 11:00:01 -07:00
Petr Hosek 1dba2a0269 [Fuchsia] Update some of the Fuchsia toolchain flags
This should make the build more self-contained.

Differential Revision: https://reviews.llvm.org/D103875
2021-06-08 10:04:19 -07:00
Petr Hosek e237168341 Revert "[Fuchsia] Use libc++abi on Windows in Fuchsia toolchain"
This reverts commit b5dd421a3a which
broke Fuchsia downstream builders.
2021-06-03 01:18:22 -07:00
Petr Hosek b5dd421a3a [Fuchsia] Use libc++abi on Windows in Fuchsia toolchain
Don't use vcruntime, this makes our toolchain more hermetic and avoids
some compiler errors we've encountered in compiler-rt.

Differential Revision: https://reviews.llvm.org/D103555
2021-06-02 14:56:27 -07:00
Leonard Chan da1db49409 [Fuchsia] Add compat multilibs to cache file
Differential Revision: https://reviews.llvm.org/D103477
2021-06-01 15:14:56 -07:00
Haowei Wu 0ce58c52d5 [Fuchsia][CMake] Add missing include path.
This patch adds include path for missing header files from "sync".
This patch also fixes the build failures caused by scudo.

Differential Revision: https://reviews.llvm.org/D103218
2021-05-26 19:59:53 -07:00
Vladimir Vereschaka b5a80a0f37 [CMake] Update Cmake cache file for Win to ARM Linux cross builds. NFC
Parametrize the cache file with TARGET_TRIPLE parameter. Normalize
the target triple to follow the runtime library installation directory.

Explicity enable LLVM_ENABLE_PER_TARGET_RUNTIME_DIR option.
2021-05-18 20:29:16 -07:00
Shoaib Meenai 56f7e5a822 [cmake] Add support for multiple distributions
LLVM's build system contains support for configuring a distribution, but
it can often be useful to be able to configure multiple distributions
(e.g. if you want separate distributions for the tools and the
libraries). Add this support to the build system, along with
documentation and usage examples.

Reviewed By: phosek

Differential Revision: https://reviews.llvm.org/D89177
2021-05-12 11:13:18 -07:00
Petr Hosek 8cb191b724 [Fuchsia][CMake] Update OSX deployment target
Use correct spelling of CMAKE_OSX_DEPLOYMENT_TARGET and bump the
minimum version to 10.13 which matches what we use for host tools
in Fuchsia.

Differential Revision: https://reviews.llvm.org/D102013
2021-05-06 12:06:16 -07:00
Vladimir Vereschaka 74d9a76ad3 [CMake] Stop using c++ subdirectory for libc++ on Win to ARM Linux cross builds. NFC
Updated cross Win-x-ARM Linux toolchain cmake cache file in according of
the following changes: https://reviews.llvm.org/D100869

Stop using use c++ subdirectory for libc++ library
2021-04-29 14:23:33 -07:00
Petr Hosek ba631240ae [CMake] Set correct CXX_FLAGS for relative-vtables variants
We overrite CXX_FLAGS to enable relative vtables, but doing so
overwrites generic Fuchsia CXX_FLAGS leading to a build failure
on Windows.

Differential Revision: https://reviews.llvm.org/D101551
2021-04-29 10:34:37 -07:00
Petr Hosek 36430d44ed [Driver] Use normalized triples for per-target runtimes
This is a partial revert of b4537c3f51
based on the discussion in https://reviews.llvm.org/D101194. Rather
than using the getMultiarchTriple, we use the getTripleString.
2021-04-27 22:31:36 -07:00
Petr Hosek 3a3fbbe217 [Fuchsia] Use correct target triple for ARM
The Debian multiarch triple is arm-linux-gnueabihf, but the target
is armv7-linux-gnueabihf because some builtins require armv7.
2021-04-26 23:48:12 -07:00
Petr Hosek b4537c3f51 [Driver] Push multiarch path setup to individual drivers
Different platforms use different rules for multiarch triples so
it's difficult to provide a single method for all platforms. We
instead move the getMultiarchTriple to the ToolChain class and let
individual platforms override it and provide their custom logic.

Differential Revision: https://reviews.llvm.org/D101194
2021-04-26 22:17:26 -07:00
Dan Liew 4c0bc69490 Ship `llvm-cxxfilt` in the toolchain.
Originally done for rdar://problem/57155465.

rdar://76602859

Differential Revision: https://reviews.llvm.org/D100405
2021-04-13 11:58:33 -07:00
Dan Liew f66e05a720 Include `count` in AppleClang toolchains.
The motivation here is so we can run the compiler-rt tests
from a standalone build against AppleClang.

In particular the `Posix/halt_on_error-torture.cpp` and
`Posix/halt_on_error_suppress_equal_pcs.cpp` ASan test cases currently
require this binary for the tests to pass.

rdar://76366784

Differential Revision: https://reviews.llvm.org/D100087
2021-04-08 14:00:29 -07:00
Dan Liew 73cbc7f60e Include `llvm-config` and `not` in AppleClang toolchains.
The motivation here is so that we can configure and run compiler-rt
tests from a standalone build against AppleClang.

rdar://75975846

Differential Revision: https://reviews.llvm.org/D100086
2021-04-07 21:29:52 -07:00
Petr Hosek 39f3e9a9e0 [CMake][Fuchsia] Include llvm-lipo
We want to use llvm-lipo for building universal libraries.

Differential Revision: https://reviews.llvm.org/D99243
2021-03-24 14:21:40 -07:00
Timm Bäder d9ef6bc426 [clang] Disable LTO and LLD on SystemZ for stage3 builds
LLD does not support SystemZ, so it doesn't make sense to use it for
boostrap/stage3 builds, and using LTO in these cases won't work.

Differential Revision: https://reviews.llvm.org/D89942
2021-03-17 15:15:41 +01:00
Petr Hosek 75cdeff43b [Fuchsia] Add check-polly to CLANG_BOOTSTRAP_TARGETS
This is necessary so we can run Polly tests in 2 stage build.

Differential Revision: https://reviews.llvm.org/D98572
2021-03-12 18:31:20 -08:00
Petr Hosek 3cd2f42521 [Fuchsia] Enable Polly for first stage as well
We want Polly enabled for both stages of the toolchain build.

Differential Revision: https://reviews.llvm.org/D98018
2021-03-05 14:35:57 -08:00
Petr Hosek 1d1983f2d0 [CMake] Enable Polly for Fuchsia toolchain build
We want to enable the use of Polly in Fuchsia.

Differential Revision: https://reviews.llvm.org/D97819
2021-03-02 16:51:16 -08:00
Ryan Prichard 729899f7b6 [libunwind] unw_* alias fixes for ELF and Mach-O
Rename the CMake option, LIBUNWIND_HERMETIC_STATIC_LIBRARY, to
LIBUNWIND_HIDE_SYMBOLS. Rename the C macro define,
_LIBUNWIND_DISABLE_VISIBILITY_ANNOTATIONS, to _LIBUNWIND_HIDE_SYMBOLS,
because now the macro adds a .hidden directive rather than merely
suppress visibility annotations.

For ELF, when LIBUNWIND_HIDE_SYMBOLS is enabled, mark unw_getcontext as
hidden. This symbol is the only one defined using src/assembly.h's
WEAK_ALIAS macro. Other unw_* weak aliases are defined in C++ and are
already hidden.

Mach-O doesn't support weak aliases, so remove .weak_reference and
weak_import. When LIBUNWIND_HIDE_SYMBOLS is enabled, output
.private_extern for the unw_* aliases.

In assembly.h, add missing SYMBOL_NAME macro invocations, which are
used to prefix symbol names with '_' on some targets.

Fixes PR46709.

Reviewed By: #libunwind, phosek, compnerd, steven_wu

Differential Revision: https://reviews.llvm.org/D93003
2021-02-22 16:54:05 -08:00
Fangrui Song 02413b097e [CMake] Delete LLVM_RUNTIME_BUILD_ID_LINK_TARGETS
Announcement: https://lists.llvm.org/pipermail/llvm-dev/2021-February/148446.html

Differential Revision: https://reviews.llvm.org/D96360
2021-02-15 11:06:23 -08:00
Andrzej Warzynski 62e4f22e29 [clang] Add AddClang.cmake to the list of the CMake modules that are installed
This makes sure that AddClang.cmake is installed alongside other Clang
CMake modules. This mirrors LLVM and MLIR in this respect and is
required when building the new Flang driver out of tree (as it depends
on Clang and includes AddClang.cmake).

Reviewed By: bogner

Differential Revision: https://reviews.llvm.org/D94533
2021-02-04 12:38:38 +00:00
Leonard Chan c0e94e9974 [clang][Fuchsia] Add relative-vtables + asan multilibs
We're choosing to take an opt-in approach for landing Relative VTables, so we'll
need asan-equivalent multilibs with relative vtables enabled. Afterwards, we can
just flip the switch in our build.

Differential Revision: https://reviews.llvm.org/D95253
2021-01-25 15:24:16 -08:00