[LLVMbugs] [Bug 6523] New: Externally visible global gets wrong name

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Sat Mar 6 08:21:59 PST 2010


           Summary: Externally visible global gets wrong name
           Product: clang
           Version: trunk
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: enhancement
          Priority: P5
         Component: C++
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: baldrick at free.fr
                CC: llvmbugs at cs.uiuc.edu, dgregor at apple.com

If I build LLVM with g++ and dragonegg with clang++ then I get a link failure
because g++ and clang++ disagree over some symbol names:

$ clang++ -S -O2 llvm-backend.ii -o - | grep Registry
    movq    $createLinearScanRegisterAllocator, Registry(%rip)
$ g++ -S -O2 llvm-backend.ii -o - | grep Registry
    movq    $_ZN4llvm33createLinearScanRegisterAllocatorEv,

Reduced testcase follows:

namespace std __attribute__ ((__visibility__ ("default"))) {
# 202 "/usr/local/include/llvm/OperandTraits.h" 3 4

namespace llvm {
  class Pass {
  class FunctionPass : public Pass {
  FunctionPass *createLinearScanRegisterAllocator();
  typedef void *(*MachinePassCtor)();
  class MachinePassRegistryNode {
  class MachinePassRegistry {
    MachinePassCtor Default;
    MachinePassRegistryNode *getList() {
    void setDefault(MachinePassCtor C) {
      Default = C;
  class RegisterRegAlloc : public MachinePassRegistryNode {
    typedef FunctionPass *(*FunctionPassCtor)();
    static MachinePassRegistry Registry;
    static void setDefault(FunctionPassCtor C) {

void LazilyInitializeModule(void) {

Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.

More information about the llvm-bugs mailing list