Преглед изворни кода

Add -L linker flag to work around gcc path issue. (#243)

Co-authored-by: Chandler Carruth <chandlerc@gmail.com>
Jon Meow пре 5 година
родитељ
комит
b2350ef8ec
1 измењених фајлова са 5 додато и 0 уклоњено
  1. 5 0
      bazel/cc_toolchains/clang_cc_toolchain_config.bzl

+ 5 - 0
bazel/cc_toolchains/clang_cc_toolchain_config.bzl

@@ -346,6 +346,11 @@ def _impl(ctx):
                             # Link with Clang's runtime library. This is always
                             # linked statically.
                             #"-rtlib=compiler-rt",
+                            # Explicitly add LLVM libs to the search path to
+                            # preempt the detected GCC installation's library
+                            # paths. Those might have a system installed libc++
+                            # and we want to find the one next to our Clang.
+                            "-L" + llvm_bindir + "/../lib",
                         ],
                     ),
                 ]),