From 2d94dd812ff6a7639f44cf118bd3cc76c5e05efe Mon Sep 17 00:00:00 2001 From: Fangrui Song Date: Tue, 18 Jun 2019 05:52:39 +0000 Subject: Revert D60974 "[clang-ifs] Clang Interface Stubs, first version." This reverts commit rC363626. clangIndex depends on clangFrontend. r363626 adds a dependency from clangFrontend to clangIndex, which creates a circular dependency. This is disallowed by -DBUILD_SHARED_LIBS=on builds: CMake Error: The inter-target dependency graph contains the following strongly connected component (cycle): "clangFrontend" of type SHARED_LIBRARY depends on "clangIndex" (weak) "clangIndex" of type SHARED_LIBRARY depends on "clangFrontend" (weak) At least one of these targets is not a STATIC_LIBRARY. Cyclic dependencies are allowed only among static libraries. Note, the dependency on clangIndex cannot be removed because libclangFrontend.so is linked with -Wl,-z,defs: a shared object must have its full direct dependencies specified on the linker command line. In -DBUILD_SHARED_LIBS=off builds, this appears to work when linking `bin/clang-9`. However, it can cause trouble to downstream clang library users. The llvm build system links libraries this way: clang main_program_object_file ... lib/libclangIndex.a ... lib/libclangFrontend.a -o exe libclangIndex.a etc are not wrapped in --start-group. If the downstream application depends on libclangFrontend.a but not any other clang libraries that depend on libclangIndex.a, this can cause undefined reference errors when the linker is ld.bfd or gold. The proper fix is to not include clangIndex files in clangFrontend. llvm-svn: 363649 --- .../InterfaceStubs/template-namespace-function.cpp | 31 ---------------------- 1 file changed, 31 deletions(-) delete mode 100644 clang/test/InterfaceStubs/template-namespace-function.cpp (limited to 'clang/test/InterfaceStubs/template-namespace-function.cpp') diff --git a/clang/test/InterfaceStubs/template-namespace-function.cpp b/clang/test/InterfaceStubs/template-namespace-function.cpp deleted file mode 100644 index 879318122b0..00000000000 --- a/clang/test/InterfaceStubs/template-namespace-function.cpp +++ /dev/null @@ -1,31 +0,0 @@ -// RUN: %clang -target x86_64-unknown-linux-gnu -o - -emit-interface-stubs \ -// RUN: -interface-stub-version=experimental-tapi-elf-v1 %s | \ -// RUN: FileCheck %s - -// RUN: %clang -target x86_64-unknown-linux-gnu -o - -c %s | llvm-nm - 2>&1 | \ -// RUN: FileCheck -check-prefix=CHECK-SYMBOLS %s - -// CHECK: Symbols: -// CHECK-DAG: _ZN3qux3barEii: { Type: Func } -// CHECK-DAG: _ZN3baz3addIiEET_S1_S1_: { Type: Func } -// CHECK-DAG: _Z4fbarff: { Type: Func } -// CHECK-DAG: _ZN3baz3addIfEET_S1_S1_: { Type: Func } - -// Same symbols just different order. -// CHECK-SYMBOLS-DAG: _Z4fbarff -// CHECK-SYMBOLS-DAG: _ZN3baz3addIfEET_S1_S1_ -// CHECK-SYMBOLS-DAG: _ZN3baz3addIiEET_S1_S1_ -// CHECK-SYMBOLS-DAG: _ZN3qux3barEii - -namespace baz { -template -T add(T a, T b) { - return a + b; -} -} // namespace baz - -namespace qux { -int bar(int a, int b) { return baz::add(a, b); } -} // namespace qux - -float fbar(float a, float b) { return baz::add(a, b); } -- cgit v1.2.3