[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


http://llvm.org/bugs/show_bug.cgi?id=9204

           Summary: Please insert "-fno-use-cxa-atexit" as default for
                    Win32
           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


http://llvm.org/bugs/show_bug.cgi?id=7276

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 ||
    !Args.hasFlag(options::OPT_fuse_cxa_atexit,
options::OPT_fno_use_cxa_atexit,
                  getToolChain().getTriple().getOS() != llvm::Triple::Win32 &&
                  getToolChain().getTriple().getOS() != llvm::Triple::Cygwin &&
                  getToolChain().getTriple().getOS() != llvm::Triple::MinGW32
&&
                  getToolChain().getTriple().getOS() != llvm::Triple::MinGW64))
    CmdArgs.push_back("-fno-use-cxa-atexit");

-- 
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