compiler-rt builtins depend on clang headers, but that dependency
wasn't explicitly stated in the build system and we were relying
on the transitive depenendecy via clang. However, when we're
cross-compiling clang, we'll be using host compiler instead and
that depenendecy is missing, breaking the build.
Differential Revision: https://reviews.llvm.org/D58471
llvm-svn: 354524
Ensure that HandleLLVMOptions adds all necessary required flags,
including -Wno-error when building with LLVM_ENABLE_WERROR enabled.
Differential Revision: https://reviews.llvm.org/D58092
llvm-svn: 353790
We shouldn't be treating runtimes builds as standalone builds since
we have enough of the context loaded into the runtimes environment.
Differential Revision: https://reviews.llvm.org/D57992
llvm-svn: 353601
The check_library_exists CMake uses a custom symbol definition. This
is a problem when checking for C library symbols because Clang
recognizes many of them as builtins, and returns the
-Wbuiltin-requires-header (or -Wincompatible-library-redeclaration)
error. When building with -Werror which is the default, this causes
the check_library_exists check fail making the build think that C
library isn't available.
To avoid this issue, we should use a symbol that isn't recognized by
Clang and wouldn't cause the same issue. __libc_start_main seems like
reasonable choice that fits the bill.
Differential Revision: https://reviews.llvm.org/D57142
llvm-svn: 352341
Do not use LLVM_RUNTIMES_LIBDIR_SUFFIX variable which is an internal
variable used by the runtimes build from individual runtimes, instead
set per-runtime librarhy directory suffix variable which is necessary
for the sanitized runtimes build to install libraries into correct
location.
Differential Revision: https://reviews.llvm.org/D49121
llvm-svn: 336713
This change adds a support for multiarch style runtimes layout, so in
addition to the existing layout where runtimes get installed to:
lib/clang/$version/lib/$os
Clang now allows runtimes to be installed to:
lib/clang/$version/$target/lib
This also includes libc++, libc++abi and libunwind; today those are
assumed to be in Clang library directory built for host, with the
new layout it is possible to install libc++, libc++abi and libunwind
into the runtime directory built for different targets.
The use of new layout is enabled by setting the
LLVM_ENABLE_RUNTIME_TARGET_DIR CMake variable and is supported by both
projects and runtimes layouts. The runtimes CMake build has been further
modified to use the new layout when building runtimes for multiple
targets.
Differential Revision: https://reviews.llvm.org/D45604
llvm-svn: 335809
This is needed when the external projects try to use other tools
besides just the compiler and the linker.
Differential Revision: https://reviews.llvm.org/D47833
llvm-svn: 334136
Summary:
This patch adds a new internal variable
LLVM_RUNTIME_DISTRIBUTION_COMPONENTS which specifies distribution
components that are part of runtime projects, and thus should be exposed
from runtime configuraitons up into the top-level CMake configurations.
This is required for allowing runtime components to be included in
LLVM_DISTRIBUTION_COMPONENTS because we verify that the build and
install targets exist for every component specified for the
distribution.
Without this patch runtimes and builtins can only be included in
distributions in whole, not by component.
Reviewers: phosek
Reviewed By: phosek
Subscribers: mgorny, llvm-commits
Differential Revision: https://reviews.llvm.org/D46705
llvm-svn: 332631
Summary:
`HandleLLVMOptions` adds `-w` to the cflags if `LLVM_ENABLE_WARNINGS` is not on.
With `-w`, `check_cxx_compiler_flag` doesn't error out for unsupported flags
(for example `-mcrc` on x86_64), and those flags end up being detected as
working - and really they aren't.
I am not entirely sure what the best way to solve this is, but setting
`LLVM_ENABLE_WARNINGS` prior to including `HandleLLVMOptions` does the job.
Reviewers: phosek, beanz
Reviewed By: phosek
Subscribers: mgorny, llvm-commits
Differential Revision: https://reviews.llvm.org/D46079
llvm-svn: 331042
This was removed in D39932 but turned out this is actually needed
because runtimes such as compiler-rt and libc++ rely on common options
processing for setting certain flags such as -ffunction-sections and
-fdata-sections.
Differential Revision: https://reviews.llvm.org/D45507
llvm-svn: 329778
When cross-compiling, we cannot use the just built toolchain, instead
we need to use the host toolchain which we assume has a support for
targeting the selected target platform. We also need to pass the path
to the native version of llvm-config to external projects.
Differential Revision: https://reviews.llvm.org/D41678
llvm-svn: 322046
These should be the only remaining missing install-*-stripped targets.
They're modeled after the existing install targets.
Differential Revision: https://reviews.llvm.org/D40927
llvm-svn: 320182
We introduce a new variable LLVM_ENABLE_RUNTIMES which works
similarly to LLVM_ENABLE_PROJECTS and allows specifying runtimes
that will be enabled in the runtimes build.
Differential Revision: https://reviews.llvm.org/D40233
llvm-svn: 319107
The passthrough is useful for setting up the options for the default
build, but we already have a different mechanism to pass CMake flags
to builds for builtins and runtimes targets so this is not really
needed there. Furthermore, when the flags are set for the default
build, with the prefix passthrough set we have to explicitly override
all options in other targets which can be cumbersome.
Differential Revision: https://reviews.llvm.org/D39988
llvm-svn: 318571
Passing lists to functions in CMake is tricky, any list argument
has to be quoted otherwise it'll be expanded. To avoid this issue,
use cmake_parse_arguments in runtime functions and pass lists using
a keyword argument which eliminates any ambiguity when dealing with
lists.
Differential Revision: https://reviews.llvm.org/D40087
llvm-svn: 318457
This is no longer needed for any of the runtimes build and it breaks
in case we don't have the working compiler yet, e.g. when building
a compiler that uses compiler-rt and libc++ as a default runtime,
because these common options check whether these are available.
Differential Revision: https://reviews.llvm.org/D39932
llvm-svn: 318227
Even when building builtins and runtimes for the default target
we shouldn't assume that the just built compiler is already useable.
When the compiler uses compiler-rt and libc++ as the default runtime
and C++ library, it won't be usable until we finish building runtimes.
Differential Revision: https://reviews.llvm.org/D39715
llvm-svn: 318224
The default host target for builtins and runtimes has special behavior
on some platforms, e.g. on Linux both i386 and x86_64 targets are being
built. Specifying "default" as a target name should lead to the same
behavior, which wasn't the case in the past. This patch unifies the
configuration between the non-target and "default" target to produce the
same behavior by moving the default configuration into a function that
can be used from both paths.
Differential Revision: https://reviews.llvm.org/D37450
llvm-svn: 312831
We need to use target specific name for all runtimes targets. Target
specific name means the name of target in the LLVM build is different
from the name in runtimes build (in LLVM build, it's suffixed by the
target itself). Previously we have only used target specific names for
check targets collected through SUB_CHECK_TARGETS, but that's not
sufficient, we need to use target specific names for all targets we're
exposing in LLVM build.
Fixes PR34335.
Differential Revision: https://reviews.llvm.org/D37245
llvm-svn: 312405
Summary:
- `project` is required when `runtime/CMakeList.txt` is the top-level `CMakeList.txt` file. This will establish version and policy settings.
- `-D_FILE_OFFSET_BITS=64` should never be set for Android runtimes.
Reviewers: srhines, pirama, beanz
Subscribers: llvm-commits, srhines, mgorny
Differential Revision: https://reviews.llvm.org/D35648
llvm-svn: 312302
This can be used to build non-sanitized and sanitized versions of
runtimes, where sanitized versions use the just built sanitizer
which in turn may use the non-sanitized version.
Differential Revision: https://reviews.llvm.org/D36348
llvm-svn: 311036
Summary:
`SUB_CHECK_TARGETS` contains all test targets in `SUB_COMPONENTS` when
we load `Components.cmake`. We don't need to add those targets
again and having duplicate targets will break the cmake policy CMP0002.
Reviewers: phosek
Subscribers: mgorny, llvm-commits, srhines, pirama
Differential Revision: https://reviews.llvm.org/D35692
llvm-svn: 308900
Summary:
This makes sure the correct lib path is being used when `CMAKE_CFG_INTDIR` or
`LLVM_LIBDIR_SUFFIX` is set.
Reviewers: beanz
Subscribers: mgorny, srhines, pirama, llvm-commits
Differential Revision: https://reviews.llvm.org/D35318
llvm-svn: 307985
This changes adds support for building runtimes for multiple
different targets using LLVM runtimes directory.
The implementation follow the model used already by the builtins
build which already supports this option. To specify the runtimes
targets to be built, use the LLVM_RUNTIME_TARGETS variable, where
the valuae is the list of targets to build runtimes for. To pass
a per target variable to the runtimes build, you can set
RUNTIMES_<target>_<variable> where <variable> will be passed to the
runtimes build for <target>.
Each runtime target (except for the default one) will be installed
into lib/<target> subdirectory. Build targets will be suffixed with
the target name.
Differential Revision: https://reviews.llvm.org/D32816
llvm-svn: 307731
Many of the test cases in the runtimes require LLVM's testing tools, to
facilitate this working as expected we need to have all the test targets
in the runtimes depend on all LLVM testing tools used in the runtimes.
Differential Revision: https://reviews.llvm.org/D33048
llvm-svn: 307572
This adds an install-builtins target to avoid having to list all
builtins targets explicitly.
Differential Revision: https://reviews.llvm.org/D32710
llvm-svn: 304587
We may not have a working C++ standard library at this point so we
shouldn't rely on it when running CMake checks.
Differential Revision: https://reviews.llvm.org/D31942
llvm-svn: 300260
This change allows cross-compiling compiler-rt builtins for
multiple targets as part of runtimes on Darwin. This functionality
is already supported on other platforms.
Differential Revision: https://reviews.llvm.org/D30957
llvm-svn: 298678
This could be used to either disable the runtimes build altogether
or avoid building them but still generate the build targets.
Differential Revision: https://reviews.llvm.org/D31060
llvm-svn: 298653
All the existing runtimes relies on flags which are set by AddLLVM
and HandleLLVMOptions. In the standalone case, they would include
these themselves, but when being built using LLVM runtimes we should
include these in the top-level runtimes CMake files.
Differential Revision: https://reviews.llvm.org/D28389
llvm-svn: 291590
This change enables building builtins for multiple different targets
using LLVM runtimes directory.
To specify the builtin targets to be built, use the LLVM_BUILTIN_TARGETS
variable, where the value is the list of targets. To pass a per target
variable to the builtin build, you can set BUILTINS_<target>_<variable>
where <variable> will be passed to the builtin build for <target>.
Differential Revision: https://reviews.llvm.org/D26652
llvm-svn: 289491
This patch builds on clang r284648, and allows the runtime directory to make the bootstrap builds depend on the builtin libraries.
This patch also make the bootstrap build depend on configuring the other runtimes because the libcxx headers are copied during configuration. I have left a TODO in the code to remove that once I come up with a better solution.
llvm-svn: 284650
Copy variable LLVM_BUILD_MAIN_SRC_DIR from LLVMConfig.cmake to
LLVM_MAIN_SRC_DIR as it is named for in-tree builds. This ensures that
add_lit_target() can reliably find llvm-lit which is not necessarily
in the PATH.
Differential Revision: https://reviews.llvm.org/D24503
llvm-svn: 281585
My previous attempt at this connected the sub-project check targets to the test-depends target instead of to the check-all target. That resulted in the tests running multiple times on bots that built "test-depends" and "check-all" in separate build invocations.
llvm-svn: 280392
This allows the builtins archives to build into the correct subdirectory under the binary dir. Addresses the issue discussed in D24001.
llvm-svn: 280002
Generating the Components import file is useless if there are no components coming in from the runtimes configuration, so we should skip generation in that case.
This also should fix the configuration error that Renato reported on llvm-dev.
llvm-svn: 279893
This will expose the check targets for runtime project components into the top-level build. It will enable exposing targets like check-asan.
llvm-svn: 279861
We need to explicitly pass LLVM_INCLUDE_TESTS through from the top-level to the runtimes configuration because it isn't in LLVMConfig.cmake
llvm-svn: 279857