[LLVMbugs] [Bug 17752] New: Version info shows "DEBUG build" for optimized builds with Visual Studio

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Thu Oct 31 04:26:17 PDT 2013


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

            Bug ID: 17752
           Summary: Version info shows "DEBUG build" for optimized builds
                    with Visual Studio
           Product: libraries
           Version: 3.0
          Hardware: PC
                OS: Windows XP
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Support Libraries
          Assignee: unassignedbugs at nondot.org
          Reporter: fredrik.littmarck at propellerheads.se
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified

This seems to be a purely cosmetical bug, but the optimized builds of llvm
tools prints the wrong version info when built with Visual Studio.

Expected:
  llvm-ld.exe --version
  Low Level Virtual Machine (http://llvm.org/):
    llvm version 3.0
    Optimized build.
    Built Apr 17 2012 (13:21:32).
    Host: i686-pc-win32
    Host CPU: corei7

Result:
  llvm-ld.exe --version
  Low Level Virtual Machine (http://llvm.org/):
    llvm version 3.0
    DEBUG build.
    Built Apr 17 2012 (13:21:32).
    Host: i686-pc-win32
    Host CPU: corei7

Probable cause:
The use of the __OPTIMIZED__ preprocessor definition in
lib/Support/CommandLine.cpp:

void print() {
    raw_ostream &OS = outs();
    OS << "Low Level Virtual Machine (http://llvm.org/):\n"
      << "  " << PACKAGE_NAME << " version " << PACKAGE_VERSION;
#ifdef LLVM_VERSION_INFO
    OS << LLVM_VERSION_INFO;
#endif
    OS << "\n  ";
#ifndef __OPTIMIZE__
    OS << "DEBUG build";
#else
    OS << "Optimized build";
#endif
#ifndef NDEBUG
    OS << " with assertions";
#endif

--- snip ---
}

__OPTIMIZE__ is never defined by MSVCC (or the CMake build scripts). This is
the only place in the llvm codebase where this macro is used from what I can
see.

It does not seem to be fixed in the trunk.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20131031/ff6b57cd/attachment.html>


More information about the llvm-bugs mailing list