[PATCH] D112238: [gn build] Make 'compiler-rt' depend on include dir

Nico Weber via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Oct 21 10:38:48 PDT 2021


thakis created this revision.
thakis added reviewers: pcc, lgrey.
Herald added a subscriber: dberris.
thakis requested review of this revision.
Herald added a project: LLVM.

That way, the headers in llvm/utils/gn/secondary/compiler-rt/include
are copied when running `ninja compiler-rt`. (Previously, they were
only copied when running `check-hwasan` or when building the
compiler-rt/include target.)

(Since they should be copied only once, depend on the target in the
host toolchain. I think default_toolchain should work just as well,
it just needs to be a single fixed toolchain. check-hwasan depends
through host_toolchain, so let's use that here too.)

Prevents errors like

  testing/fuzzed_data_provider.h:8:10: fatal error: 'fuzzer/FuzzedDataProvider.h' file not found

when building with locally-built clang. (For now, you still have to
explicitly build the 'compiler-rt' target. Maybe we should make the
clang target depend on that in the GN build?)


https://reviews.llvm.org/D112238

Files:
  llvm/utils/gn/secondary/compiler-rt/BUILD.gn


Index: llvm/utils/gn/secondary/compiler-rt/BUILD.gn
===================================================================
--- llvm/utils/gn/secondary/compiler-rt/BUILD.gn
+++ llvm/utils/gn/secondary/compiler-rt/BUILD.gn
@@ -18,7 +18,9 @@
   ]
 }
 group("compiler-rt") {
-  deps = []
+  deps = [
+    "//compiler-rt/include($host_toolchain)",
+  ]
   foreach(toolchain, supported_toolchains) {
     deps += [ "//compiler-rt/lib($toolchain)" ]
   }


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D112238.381316.patch
Type: text/x-patch
Size: 445 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20211021/2752f2bf/attachment.bin>


More information about the llvm-commits mailing list