← Back to team overview

desktop-packages team mailing list archive

[Bug 1488254]

 

I tried the "abi-tag patch version 4" attachment, and it appears to
introduce some compiler crashes under 'make check-all'. Try out
test/CodeGenCXX/static-local-in-local-class.cpp and you appear to get
unbounded recursion:

$ gdb --args /home/steven/Development/llvm/build/Release/bin/clang -cc1 -internal-isystem /home/steven/Development/llvm/build/Release/bin/../lib/clang/3.7.0/include -nostdsysteminc -triple x86_64-linux -fblocks -emit-llvm -o - /home/steven/Development/llvm/tools/clang/test/CodeGenCXX/static-local-in-local-class.cpp -std=c++1y
[...]
(gdb) bt
[...]
#26382 0x00000000014814c3 in (anonymous namespace)::CXXNameMangler::mangleLocalName(clang::Decl const*, llvm::SmallVector<llvm::StringRef, 4u> const*, bool) ()
#26383 0x0000000001481ef7 in (anonymous namespace)::CXXNameMangler::mangleNameWithAbiTags(clang::NamedDecl const*, llvm::SmallVector<llvm::StringRef, 4u> const*, bool) ()
#26384 0x000000000147c030 in (anonymous namespace)::CXXNameMangler::mangleName(clang::NamedDecl const*, bool) ()
#26385 0x0000000001479308 in (anonymous namespace)::CXXNameMangler::mangleType(clang::QualType) ()
#26386 0x000000000147cb74 in (anonymous namespace)::CXXNameMangler::mangleFunctionEncoding(clang::FunctionDecl const*, bool) ()
#26387 0x00000000014814c3 in (anonymous namespace)::CXXNameMangler::mangleLocalName(clang::Decl const*, llvm::SmallVector<llvm::StringRef, 4u> const*, bool) ()
#26388 0x0000000001481ef7 in (anonymous namespace)::CXXNameMangler::mangleNameWithAbiTags(clang::NamedDecl const*, llvm::SmallVector<llvm::StringRef, 4u> const*, bool) ()
#26389 0x000000000147c030 in (anonymous namespace)::CXXNameMangler::mangleName(clang::NamedDecl const*, bool) ()
#26390 0x0000000001479308 in (anonymous namespace)::CXXNameMangler::mangleType(clang::QualType) ()
#26391 0x000000000147cb74 in (anonymous namespace)::CXXNameMangler::mangleFunctionEncoding(clang::FunctionDecl const*, bool) ()
#26392 0x00000000014814c3 in (anonymous namespace)::CXXNameMangler::mangleLocalName(clang::Decl const*, llvm::SmallVector<llvm::StringRef, 4u> const*, bool) ()
#26393 0x0000000001481ef7 in (anonymous namespace)::CXXNameMangler::mangleNameWithAbiTags(clang::NamedDecl const*, llvm::SmallVector<llvm::StringRef, 4u> const*, bool) ()
#26394 0x000000000147c030 in (anonymous namespace)::CXXNameMangler::mangleName(clang::NamedDecl const*, bool) ()
#26395 0x0000000001479308 in (anonymous namespace)::CXXNameMangler::mangleType(clang::QualType) ()
#26396 0x000000000147cb74 in (anonymous namespace)::CXXNameMangler::mangleFunctionEncoding(clang::FunctionDecl const*, bool) ()
#26397 0x0000000001481367 in (anonymous namespace)::ItaniumMangleContextImpl::mangleCXXName(clang::NamedDecl const*, llvm::raw_ostream&) ()
#26398 0x00000000009e9eae in clang::CodeGen::CodeGenModule::getMangledName(clang::GlobalDecl) ()
#26399 0x00000000009eb14a in clang::CodeGen::CodeGenModule::GetAddrOfFunction(clang::GlobalDecl, llvm::Type*, bool, bool) ()
#26400 0x0000000000abf7c0 in clang::CodeGen::CodeGenFunction::EmitCXXMemberOrOperatorMemberCallExpr(clang::CallExpr const*, clang::CXXMethodDecl const*, clang::CodeGen::ReturnValueSlot, bool, clang::NestedNameSpecifier*, bool, clang::Expr const*) ()
#26401 0x0000000000abfe63 in clang::CodeGen::CodeGenFunction::EmitCXXOperatorMemberCallExpr(clang::CXXOperatorCallExpr const*, clang::CXXMethodDecl const*, clang::CodeGen::ReturnValueSlot) ()
#26402 0x0000000000ab4d3f in clang::CodeGen::CodeGenFunction::EmitCallExpr(clang::CallExpr const*, clang::CodeGen::ReturnValueSlot) ()
#26403 0x0000000000ab4f7a in clang::CodeGen::CodeGenFunction::EmitCallExprLValue(clang::CallExpr const*) ()
#26404 0x0000000000ab1a56 in clang::CodeGen::CodeGenFunction::EmitLValue(clang::Expr const*) ()
#26405 0x0000000000ab1de9 in clang::CodeGen::CodeGenFunction::EmitCastLValue(clang::CastExpr const*) ()
#26406 0x0000000000ab1a3e in clang::CodeGen::CodeGenFunction::EmitLValue(clang::Expr const*) ()
#26407 0x0000000000abf635 in clang::CodeGen::CodeGenFunction::EmitCXXMemberOrOperatorMemberCallExpr(clang::CallExpr const*, clang::CXXMethodDecl const*, clang::CodeGen::ReturnValueSlot, bool, clang::NestedNameSpecifier*, bool, clang::Expr const*) ()
#26408 0x0000000000abfe63 in clang::CodeGen::CodeGenFunction::EmitCXXOperatorMemberCallExpr(clang::CXXOperatorCallExpr const*, clang::CXXMethodDecl const*, clang::CodeGen::ReturnValueSlot) ()
#26409 0x0000000000ab4d3f in clang::CodeGen::CodeGenFunction::EmitCallExpr(clang::CallExpr const*, clang::CodeGen::ReturnValueSlot) ()
#26410 0x00000000006959fa in (anonymous namespace)::ScalarExprEmitter::VisitCallExpr(clang::CallExpr const*) ()
#26411 0x0000000000ad7c0c in (anonymous namespace)::ScalarExprEmitter::Visit(clang::Expr*) ()
#26412 0x0000000000ad88c0 in clang::CodeGen::CodeGenFunction::EmitScalarExpr(clang::Expr const*, bool) ()
#26413 0x00000000009b4f44 in clang::CodeGen::CodeGenFunction::EmitReturnStmt(clang::ReturnStmt const&) ()
#26414 0x00000000009b68db in clang::CodeGen::CodeGenFunction::EmitStmt(clang::Stmt const*) ()
#26415 0x00000000009b6c0f in clang::CodeGen::CodeGenFunction::EmitCompoundStmtWithoutScope(clang::CompoundStmt const&, bool, clang::CodeGen::AggValueSlot) ()
#26416 0x00000000009d45d2 in clang::CodeGen::CodeGenFunction::EmitFunctionBody(clang::CodeGen::FunctionArgList&, clang::Stmt const*) ()
#26417 0x00000000009dab03 in clang::CodeGen::CodeGenFunction::GenerateCode(clang::GlobalDecl, llvm::Function*, clang::CodeGen::CGFunctionInfo const&) ()
#26418 0x00000000009eb321 in clang::CodeGen::CodeGenModule::EmitGlobalFunctionDefinition(clang::GlobalDecl, llvm::GlobalValue*) ()
#26419 0x00000000009f50f3 in clang::CodeGen::CodeGenModule::EmitGlobalDefinition(clang::GlobalDecl, llvm::GlobalValue*) ()
#26420 0x00000000009f5a80 in clang::CodeGen::CodeGenModule::EmitGlobal(clang::GlobalDecl) ()
#26421 0x00000000009f6410 in clang::CodeGen::CodeGenModule::EmitTopLevelDecl(clang::Decl*) [clone .part.3064] [clone .constprop.3087] ()
#26422 0x00000000009f672f in clang::CodeGen::CodeGenModule::EmitNamespace(clang::NamespaceDecl const*) ()
#26423 0x00000000009f626d in clang::CodeGen::CodeGenModule::EmitTopLevelDecl(clang::Decl*) [clone .part.3064] [clone .constprop.3087] ()
#26424 0x000000000097f3b3 in (anonymous namespace)::CodeGeneratorImpl::HandleTopLevelDecl(clang::DeclGroupRef) ()
#26425 0x000000000096c14c in clang::BackendConsumer::HandleTopLevelDecl(clang::DeclGroupRef) ()
#26426 0x0000000000b46396 in clang::ParseAST(clang::Sema&, bool, bool) ()
#26427 0x00000000007c87b6 in clang::FrontendAction::Execute() ()
#26428 0x000000000079f699 in clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) ()
#26429 0x00000000007874e3 in clang::ExecuteCompilerInvocation(clang::CompilerInstance*) ()
#26430 0x0000000000781250 in cc1_main(llvm::ArrayRef<char const*>, char const*, void*) ()
#26431 0x0000000000752e12 in main ()

-- 
You received this bug notification because you are a member of Desktop
Packages, which is subscribed to llvm-toolchain-3.6 in Ubuntu.
https://bugs.launchpad.net/bugs/1488254

Title:
  clang++ no longer ABI-compatible with g++

Status in LLVM:
  Confirmed
Status in llvm-toolchain-3.6 package in Ubuntu:
  Confirmed

Bug description:
  $ cat foo.cc
  #include <string>
  std::string hello = "Hello, world!\n";
  $ cat bar.cc
  #include <string>
  #include <iostream>
  extern std::string hello;
  int main() {
      std::cout << hello;
      return 0;
  }
  $ g++ -c foo.cc && g++ foo.o bar.cc && ./a.out
  Hello, world!
  $ clang++ -c foo.cc && clang++ foo.o bar.cc && ./a.out
  Hello, world!
  $ g++ -c foo.cc && clang++ foo.o bar.cc && ./a.out
  /tmp/bar-34fb23.o: In function `main':
  bar.cc:(.text+0x14): undefined reference to `hello'
  clang: error: linker command failed with exit code 1 (use -v to see invocation)
  $ clang++ -c foo.cc && g++ foo.o bar.cc && ./a.out
  /tmp/ccqU38Mh.o: In function `main':
  bar.cc:(.text+0x5): undefined reference to `hello[abi:cxx11]'
  collect2: error: ld returned 1 exit status

  In practice, this means that many programs using C++ libraries other
  than libstdc++ fail to compile with clang++. For example, mosh fails
  with undefined references to
  google::protobuf::internal::empty_string_,
  google::protobuf::MessageLite::InitializationErrorString() const, and
  google::protobuf::MessageLite::SerializeAsString() const.

To manage notifications about this bug go to:
https://bugs.launchpad.net/llvm/+bug/1488254/+subscriptions


References