1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-19 11:02:59 +02:00
Commit Graph

138 Commits

Author SHA1 Message Date
Peter Collingbourne
0e57b6e44c gn build: Add headers to compiler-rt build files.
Also fix sort order in llvm/lib/CodeGen/GlobalISel/BUILD.gn.

llvm-svn: 351367
2019-01-16 18:45:12 +00:00
Peter Collingbourne
f67bc623d8 gn build: Merge r351283.
llvm-svn: 351293
2019-01-16 02:27:12 +00:00
Peter Collingbourne
e58561f877 gn build: Add check-hwasan target.
The Android sanitizer tests are currently some of the most difficult
to run correctly, requiring at least 3 build directories which have
to be configured in just the right way and built in the correct order
(see e.g. [1] and the functions that it calls).

This patch adds a check-hwasan target which greatly simplifies running
the hwasan tests for gn users, taking advantage of its support for
multiple toolchains. With this the tests can be run simply by setting
an NDK path and running "ninja check-hwasan" with a compatible Android
device connected. The Linux/x86_64 and Android/aarch64 targets are
tested in parallel.

[1] https://github.com/llvm/llvm-zorg/blob/master/zorg/buildbot/builders/sanitizers/buildbot_android.sh

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

llvm-svn: 351277
2019-01-16 00:15:25 +00:00
Peter Collingbourne
c6dd831c47 gn build: Add a stage2 host toolchain and make the hwasan runtime buildable on x86_64 Linux.
Differential Revision: https://reviews.llvm.org/D56711

llvm-svn: 351258
2019-01-15 22:02:12 +00:00
Peter Collingbourne
087cc9fbff gn build: Add a resource_dir.gni file.
The path to the resource directory will end up being used in several
more places once the support for running check-hwasan lands. This
moves the definition to a central location so that it can be used
from those places.

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

llvm-svn: 351255
2019-01-15 21:44:59 +00:00
Peter Collingbourne
5788f38076 gn build: Move target flags from toolchain to a .gni file.
While here, add a use_lld flag and default it to true when using
clang on non-mac.

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

llvm-svn: 351248
2019-01-15 21:24:00 +00:00
Peter Collingbourne
e504dae9e1 gn build: Add build files for compiler-rt/lib/{hwasan,interception,sanitizer_common,ubsan}.
This allows the hwasan runtime to be built for Android aarch64.

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

llvm-svn: 351246
2019-01-15 21:08:21 +00:00
Peter Collingbourne
de7b481ed5 gn build: Merge r351216, r351228.
llvm-svn: 351242
2019-01-15 21:02:49 +00:00
Craig Topper
9f55f29946 [Nios2] Remove Nios2 backend
As mentioned here http://lists.llvm.org/pipermail/llvm-dev/2019-January/129121.html This backend is incomplete and has not been maintained in several months.

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

llvm-svn: 351231
2019-01-15 19:59:19 +00:00
Hans Wennborg
28ed037d55 gn build: Don't assume valgrind.h exists on Linux
It didn't on my machine, so defaulting it to off seems better.

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

llvm-svn: 351202
2019-01-15 16:51:45 +00:00
Peter Collingbourne
dced64438d gn build: Rename llvm_host_triple to llvm_current_triple and have it use current_{cpu,os}.
This makes e.g. ToolChain::isCrossCompiling() in
clang/lib/Driver/ToolChain.cpp return the correct result
if the compiler was cross-compiled. This change also affects
llvm_default_target_triple, so cross-compiled compilers default to
targeting the cross-compilation target, which makes more sense than
the host that the compiler was compiled on.

This change will also be necessary in order for the correct triples
to appear in generated lit files for non-native targets.

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

llvm-svn: 351168
2019-01-15 08:20:29 +00:00
Peter Collingbourne
fd5e7692d9 gn build: Make a couple of improvements to the unix toolchain.
Add an asm tool (will be required for building sanitizer_common on
x64) and set a soname for DSOs so that anything that links against
them gets the correct DT_NEEDED.

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

llvm-svn: 351167
2019-01-15 08:14:38 +00:00
Peter Collingbourne
7f9dca5ace gn build: Switch to using current_os in lib/Support/BUILD.gn.
Differential Revision: https://reviews.llvm.org/D56704

llvm-svn: 351166
2019-01-15 07:17:03 +00:00
Peter Collingbourne
89ce163305 gn build: Split no-RTTI flag into a config.
Some of the sanitizer runtime code needs to be built with RTTI;
this allows that code to opt in to RTTI.

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

llvm-svn: 351155
2019-01-15 02:43:33 +00:00
Peter Collingbourne
3309a3ab97 gn build: Stop defining LLVM_ON_UNIX globally.
This macro is already being defined in llvm-config.h.

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

llvm-svn: 351154
2019-01-15 02:42:47 +00:00
Nico Weber
836b276e53 gn build: Unbreak mac build after r350977
llvm-svn: 351090
2019-01-14 18:30:35 +00:00
Nico Weber
8a58e6a620 gn build: Fix path to gn.py in docs
llvm-svn: 351088
2019-01-14 18:26:55 +00:00
Nico Weber
882a1fa563 gn build: svn propset svn:executable on utils/gn/gn.py
llvm-svn: 351085
2019-01-14 18:24:44 +00:00
Nico Weber
c11843323d gn build: Add gn.py wrapper script that adds --dotfile= and --root= parameters
Since people weren't enthused about moving the .gn file to the toplevel in
D56419, here's a script to make gn at least somewhat more pleasant to invoke
(useful for gn clean, gn args --list, gn desc, etc).

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

llvm-svn: 351064
2019-01-14 12:50:40 +00:00
James Y Knight
c73d346797 Remove TypeBuilder.h, and fix the few locations using it.
This shortcut mechanism for creating types was added 10 years ago, but
has seen almost no uptake since then, neither internally nor in
external projects.

The very small number of characters saved by using it does not seem
worth the mental overhead of an additional type-creation API, so,
delete it.

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

llvm-svn: 351020
2019-01-13 16:09:28 +00:00
Nico Weber
f1fb3280a5 gn build: Unbreak Windows build
I didn't break all that much during upstreaming, just needs two small fixes:

- fix spelling of MCJITTests.def file
- make libLTO a shared_library to put it in bin/ on Windows where it is in the
  CMake build too

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

llvm-svn: 351004
2019-01-12 11:56:47 +00:00
Peter Collingbourne
2b7752ef46 gn build: Add a stage2 toolchain for Android.
This makes it possible to build llvm-symbolizer for Android, which
is one of the prerequisites for running the sanitizer tests on Android.

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

llvm-svn: 350979
2019-01-11 23:18:51 +00:00
Peter Collingbourne
2308749462 gn build: Create a template for unix toolchains.
Also change the toolchain description to use current_os instead of
host_os so that the template can be used for cross builds, and add
a current_os to the win toolchain to match the unix toolchain.

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

llvm-svn: 350977
2019-01-11 22:57:57 +00:00
Peter Collingbourne
1b191b21b0 gn build: Merge r350958.
llvm-svn: 350974
2019-01-11 22:15:53 +00:00
Peter Collingbourne
44ac195a8a gn build: Create a variable for the host toolchain and start using it in the tblgen template.
Differential Revision: https://reviews.llvm.org/D56575

llvm-svn: 350964
2019-01-11 19:53:06 +00:00
Peter Collingbourne
9a277e9cce gn build: s/root_out_dir/root_build_dir/g in llvm/utils/gn/build/write_cmake_config.gni.
This makes the generated files go to the right place when using a non-default toolchain.

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

llvm-svn: 350963
2019-01-11 19:51:49 +00:00
Nico Weber
899d99c29c gn build: Add a template for calling write_cmake_config.py
No behavior change.

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

llvm-svn: 350905
2019-01-10 23:10:04 +00:00
Nico Weber
21b2053fcc gn build: Merge r350852
llvm-svn: 350904
2019-01-10 23:05:39 +00:00
Peter Collingbourne
a112e209cc gn build: Use "git rev-parse --git-dir" to discover the path to the .git directory.
This makes it compatible with worktrees.

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

llvm-svn: 350897
2019-01-10 21:57:07 +00:00
Nico Weber
e506e53314 gn build: Merge r350893
llvm-svn: 350894
2019-01-10 21:47:10 +00:00
Nico Weber
244c6fbbbb gn build: Merge r350819
llvm-svn: 350829
2019-01-10 15:16:32 +00:00
Nico Weber
8e2314675c [gn build] Run git ls-files '*.gn' '*.gni' | xargs -n 1 gn format
Looks like I forgot to do that for the PowerPC target.

llvm-svn: 350711
2019-01-09 12:57:52 +00:00
Nico Weber
369110ea34 [gn build] Merge r350669
llvm-svn: 350709
2019-01-09 12:48:06 +00:00
Nico Weber
81ba404f62 [gn build] Add a TODO.txt file
Differential Revision: https://reviews.llvm.org/D56420

llvm-svn: 350708
2019-01-09 12:46:04 +00:00
Alexander Kornienko
070b71657b Make the write_cmake_config.py script python3-compatible
llvm-svn: 350700
2019-01-09 10:49:44 +00:00
Peter Collingbourne
ff49844d20 gn build: Copy file permissions from input file in configure_file() emulation.
Most significantly, this makes bin/llvm-lit executable so that it
can be run in the usual way.

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

llvm-svn: 350688
2019-01-09 04:39:29 +00:00
Peter Collingbourne
15d0ad0568 gn build: Fix a Python2ism in write_vcsrevision.py.
Convert the output of "git rev-parse --short HEAD" to a string before
substituting it into the output file. Without this the output file
will look like this on Python 3:

 #define LLVM_REVISION "git-b'6a4895a025f'"

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

llvm-svn: 350686
2019-01-09 04:05:07 +00:00
Nico Weber
0aed3f8c9d [gn build] Update readme
Differential Revision: https://reviews.llvm.org/D56375

llvm-svn: 350632
2019-01-08 15:19:00 +00:00
Nico Weber
626465a5d8 [gn build] Make sync_source_lists_from_cmake.py check that all LLVM unittests are present
Now that the PowerPC and WebAssembly targets are added, this check passes.

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

llvm-svn: 350631
2019-01-08 15:17:19 +00:00
Nico Weber
5f6df0d499 [gn build] Add build files for llvm/lib/Target/PowerPC + tests
The PowerPC target itself is similar to the X86 target in https://reviews.llvm.org/rL348903
The llvm-exegesis unittests bits are similar to the corresponding AArch64 in https://reviews.llvm.org/rL350499
The whole patch is very similar to the WebAssembly target being added in https://reviews.llvm.org/rL350628

Also add a dep from tools/llvm-exegesis/lib to the AArch64 subdir, which I
failed to do in r350499.

The motivation for this target is solely that it has a unit test and I want to
enable the GN<->CMake unittest syncing check for llvm.

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

llvm-svn: 350629
2019-01-08 15:16:14 +00:00
Nico Weber
b72ac813cd [gn build] Add build files for llvm/lib/Target/WebAssembly + tests
The WebAssembly target itself is similar to the X86 target in https://reviews.llvm.org/rL348903
The unittests bits are similar to the corresponding AArch64 in https://reviews.llvm.org/rL350499

The motivation for this target is solely that it has a unit test and I want to
enable the GN<->CMake unittest syncing check for llvm. (After this, only the
PowerPC target is needed and I can turn it on.)

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

llvm-svn: 350628
2019-01-08 15:12:42 +00:00
Peter Collingbourne
91cddf4ad1 gn build: Stop passing -o to ar.
The -o flag means something different to ar than what appears to be
intended here. Also, llvm-ar doesn't accept the flag in this position.

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

llvm-svn: 350604
2019-01-08 04:00:22 +00:00
Peter Collingbourne
7e788104a4 gn build: Merge r350580.
llvm-svn: 350600
2019-01-08 01:46:57 +00:00
Nico Weber
6ee9d1c968 [gn build] Add build files for llvm/lib/Target/ARM + tests
The ARM target itself is similar to the X86 target in https://reviews.llvm.org/rL348903
The llvm-exegesis unittests ARM bits are similar to the X86 bits in https://reviews.llvm.org/rL350413
Both are similar to the corresponding AArch64 bits in https://reviews.llvm.org/rL350499 too

After this, everything in my local GN branch is upstreamed to LLVM.

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

llvm-svn: 350500
2019-01-07 01:26:12 +00:00
Nico Weber
001174a89a [gn build] Add build files for llvm/lib/Target/AArch64 + tests
The AArch64 target itself is similar to the X86 target in https://reviews.llvm.org/rL348903
The llvm-exegesis AArch64 bits are similar to the X86 bits in http://reviews.llvm.org/rL350184
The llvm-exegesis unittests AArch64 bits are similar to the X86 bits in https://reviews.llvm.org/rL350413

llvm/unittests/Target/AArch64 doesn't have an equivalent since the X86 Target
only has lit tests, no unittests.

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

llvm-svn: 350499
2019-01-07 01:23:11 +00:00
Nico Weber
9757ebb64f [gn build] Merge r350341
Adds a build file for llvm-elfabi and makes check-llvm depend on it.

llvm-svn: 350494
2019-01-06 15:49:10 +00:00
Nico Weber
c2fff4a289 [gn build] Add build files for LLVM unittests with a custom main() function
Differential Revision: https://reviews.llvm.org/D56219

llvm-svn: 350492
2019-01-06 15:09:22 +00:00
Nico Weber
ef51073c71 [gn build] Merge r350423
llvm-svn: 350458
2019-01-05 05:01:20 +00:00
Nico Weber
46ba40fe63 [gn build] Add build files for unittests under llvm/unittests/ExecutionEngine
Differential Revision: https://reviews.llvm.org/D56328

llvm-svn: 350457
2019-01-05 04:05:25 +00:00
Nico Weber
aa255842e3 [gn build] Add build files for unittests that load shared libraries
This is slightly ugly for three reasons:

- The shlib needs to go next to the binary to be found on all platforms, so the
  build files refer to target_out_dir
- The explicit -fPIC flag needed on the shared lib side, and the -rdynamic flag
  needed on the host side, on Linux 
- Plugins that refer to LLVM code and assume that the host will resolve them
  don't work on Windows -- PluginsTests won't test anything on Windows (but
  DynamicLibraryTests will, since the dll here doesn't call LLVM code)


If we get lots more of these plugin / plugin host targets it might make sense
to add a template for them. But for now, these are the last ones we need.

(We're at 6 plugin hosts, 2 of them tests, and at 6 shared libraries, 2 of them
tests as well. clang is a plugin host by default in the CMake build but not
(yet?) in the GN build.)

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

llvm-svn: 350454
2019-01-05 01:39:18 +00:00