diff --git a/clang/lib/Driver/ToolChains/InterfaceStubs.cpp b/clang/lib/Driver/ToolChains/InterfaceStubs.cpp --- a/clang/lib/Driver/ToolChains/InterfaceStubs.cpp +++ b/clang/lib/Driver/ToolChains/InterfaceStubs.cpp @@ -46,6 +46,8 @@ // Here we append the input files. If the input files are object files, then // we look for .ifs files present in the same location as the object files. for (const auto &Input : Inputs) { + if (!Input.isFilename()) + continue; SmallString<128> InputFilename(Input.getFilename()); if (Input.getType() == types::TY_Object) llvm::sys::path::replace_extension(InputFilename, ".ifs"); diff --git a/clang/test/InterfaceStubs/XlinkerInputArgs.cpp b/clang/test/InterfaceStubs/XlinkerInputArgs.cpp new file mode 100644 --- /dev/null +++ b/clang/test/InterfaceStubs/XlinkerInputArgs.cpp @@ -0,0 +1,3 @@ +// RUN: %clang -### -Xlinker -Bsymbolic -emit-interface-stubs 2>&1 | FileCheck %s +// CHECK: Bsymbolic +// CHECK-NOT: Bsymbolic