[LLVMbugs] [Bug 9204] New: Please insert "-fno-use-cxa-atexit" as default for Win32

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Fri Feb 11 22:57:29 PST 2011


           Summary: Please insert "-fno-use-cxa-atexit" as default for
           Product: clang
           Version: trunk
          Platform: PC
        OS/Version: Windows NT
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Driver
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: art.oriented at gmail.com
                CC: llvmbugs at cs.uiuc.edu


This bug still happens for native Win32. So, C++ code causes link errors:

 error LNK2019: unresolved external symbol ___dso_handle referenced
 error LNK2019: unresolved external symbol ___cxa_atexit referenced

The fix would be very simple: just put '--fno-use-cxa-atexit' as default
argument. Please fix "tools\clang\lib\Driver\Tools.cpp" as follows (sorry I
don't have permit to commit yet):

  // -fuse-cxa-atexit is default.
  if (KernelOrKext ||
                  getToolChain().getTriple().getOS() != llvm::Triple::Win32 &&
                  getToolChain().getTriple().getOS() != llvm::Triple::Cygwin &&
                  getToolChain().getTriple().getOS() != llvm::Triple::MinGW32
                  getToolChain().getTriple().getOS() != llvm::Triple::MinGW64))

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