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 --- clang/lib/Frontend/CompilerInvocation.cpp | 21 --------------------- 1 file changed, 21 deletions(-) (limited to 'clang/lib/Frontend/CompilerInvocation.cpp') diff --git a/clang/lib/Frontend/CompilerInvocation.cpp b/clang/lib/Frontend/CompilerInvocation.cpp index 0ec8e11..fc49aa6 100644 --- a/clang/lib/Frontend/CompilerInvocation.cpp +++ b/clang/lib/Frontend/CompilerInvocation.cpp @@ -1681,25 +1681,6 @@ static InputKind ParseFrontendArgs(FrontendOptions &Opts, ArgList &Args, Opts.ProgramAction = frontend::GenerateHeaderModule; break; case OPT_emit_pch: Opts.ProgramAction = frontend::GeneratePCH; break; - case OPT_emit_iterface_stubs: { - llvm::Optional ProgramAction = - llvm::StringSwitch>( - Args.hasArg(OPT_iterface_stub_version_EQ) - ? Args.getLastArgValue(OPT_iterface_stub_version_EQ) - : "") - .Case("experimental-yaml-elf-v1", - frontend::GenerateInterfaceYAMLExpV1) - .Case("experimental-tapi-elf-v1", - frontend::GenerateInterfaceTBEExpV1) - .Default(llvm::None); - if (!ProgramAction) - Diags.Report(diag::err_drv_invalid_value) - << "Must specify a valid interface stub format type using " - << "-interface-stub-version="; - Opts.ProgramAction = *ProgramAction; - break; - } case OPT_init_only: Opts.ProgramAction = frontend::InitOnly; break; case OPT_fsyntax_only: @@ -3132,8 +3113,6 @@ static bool isStrictlyPreprocessorAction(frontend::ActionKind Action) { case frontend::GenerateModuleInterface: case frontend::GenerateHeaderModule: case frontend::GeneratePCH: - case frontend::GenerateInterfaceYAMLExpV1: - case frontend::GenerateInterfaceTBEExpV1: case frontend::ParseSyntaxOnly: case frontend::ModuleFileInfo: case frontend::VerifyPCH: -- cgit v1.1