Commit Graph

125 Commits

Author SHA1 Message Date
Petr Hosek da91431842 [Driver] Support XRay on Fuchsia
This enables support for XRay in Fuchsia Clang driver.

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

llvm-svn: 347444
2018-11-22 02:36:47 +00:00
Petr Hosek 4fd065a4ac [CMake] Use lld and llvm-objcopy for first stage compiler in Fuchsia
When cross-compiling the second stage to a different target, we need to
make sure that the first-stage compiler can produce binaries for that
target. Using lld and llvm-objcopy as the default linker and objcopy
tool eliminates some of the dependencies on the host toolchain.

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

llvm-svn: 347108
2018-11-16 23:07:03 +00:00
Petr Hosek d63e846212 [CMake] Support cross-compiling with Fuchsia toolchain build
When second stage is being cross-compiled for a different platform
we need to build enough of first stage runtimes to get a working
compiler.

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

llvm-svn: 347026
2018-11-16 04:50:12 +00:00
Petr Hosek 1ee2987abc [CMake] Use the correct spelling for armv7 in Fuchsia's toolchain
We need to explicitly specify the architecture version.

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

llvm-svn: 347021
2018-11-16 04:09:47 +00:00
Petr Hosek 54e9735824 [CMake] Explicitly list Linux targets for Fuchsia toolchain
Not all Linux targets use the ${arch}-linux-gnu spelling, so instead
specify the list of Linux explicitly.

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

llvm-svn: 346997
2018-11-15 21:55:59 +00:00
Petr Hosek e913415d1b [CMake] Include clang-apply-replacements in Fuchsia toolchain
This is needed for run-clang-tidy.py.

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

llvm-svn: 346827
2018-11-14 04:06:47 +00:00
Petr Hosek 869af342c7 [CMake][Fuchsia] Set -fuse-ld=lld explicitly for Linux runtimes
We set lld as the default linker on non-Darwin platforms, but we still
need to set -fuse-ld=lld explicitly in to support cross-compiling Linux
runtimes on Darwin.

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

llvm-svn: 346056
2018-11-02 23:49:36 +00:00
Petr Hosek 8487d22d12 [CMake][Fuchsia] Don't restrict Linux runtimes to UNIX
This allows building Linux runtimes on any platform if the correct
sysroot is provided via CMake option.

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

llvm-svn: 345889
2018-11-01 20:36:33 +00:00
Petr Hosek 02882b93ad [CMake][Fuchsia] Drop the LIBCXX_HIDE_FROM_ABI_PER_TU_BY_DEFAULT
Now that libc++ uses __exclude_from_explicit_instantiation__ attribute,
this is no longer needed.

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

llvm-svn: 345552
2018-10-29 23:10:49 +00:00
Petr Hosek d3265358b4 [Driver] Support direct split DWARF emission for Fuchsia
This enables the driver support for direct split DWARF emission for
Fuchsia in addition to Linux.

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

llvm-svn: 344556
2018-10-15 21:30:32 +00:00
Enrico Steffinlongo 11b6cedb8e [analyzer] Improved cmake configuration for Z3
Summary:
Enhanced support for Z3 in the cmake configuration of clang; now it is possible to specify any arbitrary Z3 install prefix (CLANG_ANALYZER_Z3_PREFIX) to cmake with lib (or bin) and include folders. Before the patch only in cmake default locations
were searched (https://cmake.org/cmake/help/v3.4/command/find_path.html).

Specifying any CLANG_ANALYZER_Z3_PREFIX will force also CLANG_ANALYZER_BUILD_Z3 to ON.

Removed also Z3 4.5 version requirement since it was not checked, and now Clang works with Z3 4.7

Reviewers: NoQ, george.karpenkov, mikhail.ramalho

Reviewed By: george.karpenkov

Subscribers: rnkovacs, NoQ, esteffin, george.karpenkov, delcypher, ddcc, mgorny, xazax.hun, szepet, a.sidorin, Szelethus

Tags: #clang

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

llvm-svn: 344464
2018-10-13 19:45:48 +00:00
Petr Hosek ed8311da5a [CMake][Fuchsia] Use libc++ ABIv2 for Fuchsia toolchain
We don't need to provide stable ABI and hence we can use the v2.

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

llvm-svn: 343652
2018-10-03 01:27:00 +00:00
Haojian Wu 06098849c6 Build clang-headers when building clang tools.
Summary:
clang tools require clang headers to work on real project, e.g. when we
build clangd via `ninja clangd`, we expect the binary can run on
real-world project (without running another command `ninja clang-headers`).

Reviewers: sammccall

Reviewed By: sammccall

Subscribers: mgorny, ilya-biryukov, ioeric, kadircet, cfe-commits

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

llvm-svn: 343459
2018-10-01 12:16:38 +00:00
Petr Hosek b2de4b39be [CMake] Use internal_linkage rather than always_inline for libc++
This is a workaround for PR39053 which was uncovered by D50652 when
the default attribute has been changed from internal_linkage to
always_inline.

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

llvm-svn: 342833
2018-09-23 08:46:31 +00:00
Petr Hosek 427b895e2f [CMake] Link static libunwind and libc++abi into libc++ in Fuchsia toolchain
When building libc++ for Fuchsia, we want to distribute shared libc++,
libc++abi and libunwind as separate libraries, but for static versions
we would like to link all of them into libc++ so -lc++ flag has the same
effect whether shared or static library is being used.

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

llvm-svn: 337877
2018-07-25 01:44:22 +00:00
Petr Hosek ada5119c39 [CMake] Use libc++ and compiler-rt for sanitizers
When building runtimes for Linux as part of Fuchsia toolchain, use
libc++ and compiler-rt for sanitizers.

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

llvm-svn: 337117
2018-07-15 03:11:43 +00:00
Petr Hosek 0b9629b286 [CMake] Don't build Linux targets on Darwin in Fuchsia toolchain
This is currently breaking because Linux target sysroots rely on
case sensitive filesystem which is not by default enabled on macOS.

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

llvm-svn: 335919
2018-06-28 20:33:18 +00:00
Petr Hosek e52b752973 [CMake] Build static runtimes for host in Fuchsia first stage
First stage build is only a minimal build where we don't need
a complete multiarch support, but we need enough to build the
second stage.

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

llvm-svn: 335917
2018-06-28 20:19:11 +00:00
Petr Hosek 2423c16935 [CMake] Use explicit targets for building Linux runtimes
Previously we were using default logic when building Linux runtimes
in Fuchsia toolchain, but that leads to various issues due to how
the CMake logic in compiler-rt for determining the platform support
is implemented. With this change, we will use explicit target for
every provided Linux sysroot.

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

llvm-svn: 335812
2018-06-28 05:15:46 +00:00
Petr Hosek 7636840b87 [CMake] Support passing FUCHSIA_SDK as the only variable
Now that the structure of Fuchsia SDK has been formalized, we no
longer need to pass all the different CFLAGS/LDFLAGS to the CMake
build separately, we can simply set the FUCHSIA_SDK variable and
derive all the necessary variables from that one inside the cache
file.

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

llvm-svn: 335708
2018-06-27 05:50:43 +00:00
Petr Hosek 7e5e3edc95 [CMake] Provide direct support for building sanitized runtimes
This avoids having to rely on magic separators and special parsing.

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

llvm-svn: 335704
2018-06-27 03:35:53 +00:00
Francis Visoiu Mistrih 081568fb2d Revert "[CMake][Darwin] Match cxx-headers -> cxx_headers libcxx target rename."
This reverts commit r334550. Try to fix the stage2 build failing on
Green Dragon for a while.

http://green.lab.llvm.org/green/job/clang-stage2-Rthinlto/11124/console

llvm-svn: 335628
2018-06-26 17:05:01 +00:00
Petr Hosek 96917d7912 [Fuchsia] Enable static libc++, libc++abi, libunwind
This is needed for building Fuchsia drivers.

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

llvm-svn: 335410
2018-06-23 03:15:07 +00:00
Ahmed Bougacha 5d89760ea4 [CMake][Darwin] Match cxx-headers -> cxx_headers libcxx target rename.
This was changed in r334477.

llvm-svn: 334550
2018-06-12 21:27:36 +00:00
Petr Hosek 5e1f49e89b [CMake] Use libc++ and compiler-rt for bootstrap Fuchsia Clang
We want to build the second stage compiler with libc++ and compiler-rt,
also include builtins and runtimes into extra bootstrap components to
ensure these get built.

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

llvm-svn: 334445
2018-06-11 22:06:44 +00:00
Petr Hosek 8084f91e92 [Fuchsia] Include install-distribution-stripped in bootstrap targets
This enables the use of install-distribution-stripped target in the
2-stage builds.

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

llvm-svn: 334063
2018-06-06 05:18:39 +00:00
Petr Hosek cfa9854830 Set CMAKE_BUILD_WITH_INSTALL_RPATH for Fuchsia runtimes
This doesn't make any difference since we don't use RPATH/RUNPATH
on Fuchsia but it avoids the CMake error when re-linking libraries
while building with Ninja.

Differntial Revision: https://reviews.llvm.org/D46610

llvm-svn: 331833
2018-05-09 00:58:12 +00:00
Petr Hosek 9befdb8814 [CMake] Include llvm-strip in Fuchsia toolchain distribution
Now that llvm-strip is available, include it in the Fuchsia toolchain.

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

llvm-svn: 331826
2018-05-09 00:05:28 +00:00
Petr Hosek 403793e7b5 [CMake] Pass additional CMake flags in Fuchsia cache files
This allows passing additional CMake flags to builtins and runtimes
build through Fuchsia cache files.

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

llvm-svn: 331717
2018-05-08 02:47:13 +00:00
Petr Hosek edb6ff8c06 [CMake][Cache] Stop pretending that Fuchsia is UNIX
This changes some aspects of the build that are not relevant or useful
for Fuchsia like setting the RPATH/RUNPATH.

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

llvm-svn: 331425
2018-05-03 01:44:03 +00:00
Petr Hosek 17fdef6606 [CMake] Enable libc++ for Fuchsia toolchain on Darwin
This is necessary in order to get a working C++ compiler on Darwin
since Clang expects libc++ headers to be part of the toolchain.

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

llvm-svn: 330855
2018-04-25 18:30:55 +00:00
Petr Hosek 35ad9ee3cb [CMake][Fuchsia] Don't specify libc++ ABI version for Fuchsia
This is now set automatically in libc++ config header.

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

llvm-svn: 329984
2018-04-13 02:02:13 +00:00
Alexander Kornienko 2a8c18d991 Fix typos in clang
Found via codespell -q 3 -I ../clang-whitelist.txt
Where whitelist consists of:

  archtype
  cas
  classs
  checkk
  compres
  definit
  frome
  iff
  inteval
  ith
  lod
  methode
  nd
  optin
  ot
  pres
  statics
  te
  thru

Patch by luzpaz! (This is a subset of D44188 that applies cleanly with a few
files that have dubious fixes reverted.)

Differential revision: https://reviews.llvm.org/D44188

llvm-svn: 329399
2018-04-06 15:14:32 +00:00
Petr Hosek a664dac0eb [Fuchsia] Don't install libc++, libc++abi or libunwind on Darwin
The Clang driver doesn't currently know how to use the libraries
that are shipped as part of the toolchain so there's no reason to
ship them at all.

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

llvm-svn: 328114
2018-03-21 16:48:26 +00:00
Petr Hosek 0f0fb0a06f [CMake] Use libc++ and compiler-rt as default libraries in Fuchsia toolchain
Fuchsia already defaults to libc++ and compiler-rt, but we want to use
these as default runtimes even on the host platform.

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

llvm-svn: 327860
2018-03-19 15:19:19 +00:00
Jonas Devlieghere a6ef1abc09 [dsymutil] Rename llvm-dsymutil -> dsymutil
Now that almost all functionality of Apple's dsymutil has been
upstreamed, the open source variant can be used as a drop in
replacement. Hence we feel it's no longer necessary to have the llvm
prefix.

Differential revision: https://reviews.llvm.org/D44527

llvm-svn: 327790
2018-03-18 11:38:41 +00:00
Petr Hosek 0d9c9bef4e [Fuchsia] Include libClang and clang-include-fixer in the toolchain
libClang is used by other Clang based tools such as cquery while
clang-include-fixer is generally a useful tool.

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

llvm-svn: 325665
2018-02-21 04:39:15 +00:00
Vassil Vassilev e151501615 Revert r323051 "[cmake] Use CLANG_BINARY_DIR to determine the build directory."
This broke swift builds.

Thanks for the post-commit review of Chris Bieneman and Davide Italiano!

llvm-svn: 323368
2018-01-24 19:26:50 +00:00
Vassil Vassilev 5829d8f1f7 [cmake] Use CLANG_BINARY_DIR to determine the build directory.
The patch puts the ClangConfig.cmake in the expected location  when clang is
embedded into a framework.

llvm-svn: 323051
2018-01-20 21:43:35 +00:00
Petr Hosek 98a57ad6ce [Fuchsia] Remove LLDB from the toolchain distribution
This is currently not being used so disable it to reduce toolchain size.

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

llvm-svn: 322253
2018-01-11 04:25:30 +00:00
Petr Hosek e4825b8dc4 [Fuchsia] Use llvm-objcopy as objcopy on non-Darwin hosts
llvm-objcopy already supports all the necessary functionality for ELF.

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

llvm-svn: 322252
2018-01-11 04:17:57 +00:00
Petr Hosek 7279762fc0 [CMake][Fuchsia] Enable assertions
Enable assertions in both stages.
Release+Asserts is fast enough.
No need to let insanity through.

Patch By: mcgrathr

Reviewers: phosek

Reviewed By: phosek

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

llvm-svn: 321316
2017-12-21 22:10:27 +00:00
Duncan P. N. Exon Smith 6c63b07a55 Update Clang CMake cache to use cxx-headers, NFC
Apparently libcxx-headers is going away.  Fixes PR35584.

llvm-svn: 320271
2017-12-09 23:44:42 +00:00
Shoaib Meenai 669cae1f28 [clang] Use add_llvm_install_targets
Use this function to create the install targets rather than doing so
manually, which gains us the `-stripped` install targets to perform
stripped installations.

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

llvm-svn: 319489
2017-11-30 22:35:02 +00:00
Petr Hosek 86cc84d12e [CMake][Fuchsia] Disable terminfo database in Fuchsia toolchain
It's used to determine whether terminal supports colors, but within LLVM
it's only used in handful of places and in Clang it's only used in AST
dumper, otherwise Clang relies on the -fcolor-diagnostics flag which we
pass explicitly from our build system anyway. This eliminates one of the
shared libraries dependencies making the toolchain less reliant on the
host environment.

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

llvm-svn: 319088
2017-11-27 20:29:13 +00:00
Petr Hosek 5668d83e0e [Driver] Make the use of relax relocations a per target option
The support for relax relocations is dependent on the linker and
different toolchains within the same compiler can be using different
linkers some of which may or may not support relax relocations.

Give toolchains the option to control whether they want to use relax
relocations in addition to the existing (global) build system option.

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

llvm-svn: 318816
2017-11-22 01:38:31 +00:00
Vitaly Buka 1efe7740ce [clang-fuzzer] Fix incremental builds of the fuzzer
Summary:
Don't use BUILD_IN_SOURCE keep git checkout clean
Don't forward CMAKE_GENERATOR as ExternalProject_Add should do it already
Reset UPDATE_COMMAND to avoid git checkout updates on each build

Reviewers: kcc, morehouse

Subscribers: cfe-commits, mgorny

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

llvm-svn: 317035
2017-10-31 20:49:57 +00:00
Petr Hosek 9f46ece85a [CMake] Build host builtins in Fuchsia toolchain even on Darwin
This is nedeeded for the toolchain to be actually usable as a host
toolchain on Darwin.

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

llvm-svn: 316542
2017-10-25 02:35:22 +00:00
Petr Hosek a9eaf1d226 [CMake] Include clang-refactor in Fuchsia toolchain
This includes the clang-refactor in the toolchain distribution.

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

llvm-svn: 316541
2017-10-25 02:31:38 +00:00
Matt Morehouse 54ffd1cfe8 [clang-proto-fuzzer] Use ToT protobuf-mutator.
llvm-svn: 316103
2017-10-18 18:38:04 +00:00