<html>
    <head>
      <base href="https://bugs.llvm.org/">
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - Crash when using macho with win32"
   href="https://bugs.llvm.org/show_bug.cgi?id=33300">33300</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Crash when using macho with win32
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>clang
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>trunk
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Linux
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>enhancement
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>C++
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedclangbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>piotr.padlewski@gmail.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>dgregor@apple.com, llvm-bugs@lists.llvm.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Clang crashes with this target: x86_64-pc-win32-macho. To replicate use any
c/c++ file with this target:

prazek@0x01:~ $ cat 1.cpp 
// empty

prazek@0x01:~ $ ~/llvm-build-release/bin/clang++ 1.cpp -o - -emit-llvm -S
-target x86_64-pc-win32-macho
clang-5.0: /home/prazek/llvm/tools/clang/lib/CodeGen/CodeGenModule.cpp:479:
void clang::CodeGen::CodeGenModule::Release(): Assertion `(LangOpts.ShortWChar
|| llvm::TargetLibraryInfoImpl::getTargetWCharSize(Target.getTriple()) ==
Target.getWCharWidth() / 8) && "LLVM wchar_t size out of sync"' failed.
#0 0x0000000003327c14 PrintStackTraceSignalHandler(void*)
(/home/prazek/llvm-build-release/bin/clang-5.0+0x3327c14)
#1 0x0000000003327f56 SignalHandler(int)
(/home/prazek/llvm-build-release/bin/clang-5.0+0x3327f56)
#2 0x00007f02b8955390 __restore_rt
(/lib/x86_64-linux-gnu/libpthread.so.0+0x11390)
#3 0x00007f02b74c0428 gsignal
/build/glibc-9tT8Do/glibc-2.23/signal/../sysdeps/unix/sysv/linux/raise.c:54:0
#4 0x00007f02b74c202a abort /build/glibc-9tT8Do/glibc-2.23/stdlib/abort.c:91:0
#5 0x00007f02b74b8bd7 __assert_fail_base
/build/glibc-9tT8Do/glibc-2.23/assert/assert.c:92:0
#6 0x00007f02b74b8c82 (/lib/x86_64-linux-gnu/libc.so.6+0x2dc82)
#7 0x00000000035c0c8e (/home/prazek/llvm-build-release/bin/clang-5.0+0x35c0c8e)
#8 0x0000000003b06575 (anonymous
namespace)::CodeGeneratorImpl::HandleTranslationUnit(clang::ASTContext&)
(/home/prazek/llvm-build-release/bin/clang-5.0+0x3b06575)
#9 0x0000000003b04401
clang::BackendConsumer::HandleTranslationUnit(clang::ASTContext&)
(/home/prazek/llvm-build-release/bin/clang-5.0+0x3b04401)
#10 0x000000000426ebf5 clang::ParseAST(clang::Sema&, bool, bool)
(/home/prazek/llvm-build-release/bin/clang-5.0+0x426ebf5)
#11 0x0000000003a565a8 clang::FrontendAction::Execute()
(/home/prazek/llvm-build-release/bin/clang-5.0+0x3a565a8)
#12 0x00000000039adeb1
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&)
(/home/prazek/llvm-build-release/bin/clang-5.0+0x39adeb1)
#13 0x0000000003afea1d
clang::ExecuteCompilerInvocation(clang::CompilerInstance*)
(/home/prazek/llvm-build-release/bin/clang-5.0+0x3afea1d)
#14 0x0000000001bce733 cc1_main(llvm::ArrayRef<char const*>, char const*,
void*) (/home/prazek/llvm-build-release/bin/clang-5.0+0x1bce733)
#15 0x0000000001bccfce main
(/home/prazek/llvm-build-release/bin/clang-5.0+0x1bccfce)
#16 0x00007f02b74ab830 __libc_start_main
/build/glibc-9tT8Do/glibc-2.23/csu/../csu/libc-start.c:325:0
#17 0x0000000001bca029 _start
(/home/prazek/llvm-build-release/bin/clang-5.0+0x1bca029)
Stack dump:
0.      Program arguments: /home/prazek/llvm-build-release/bin/clang-5.0 -cc1
-triple x86_64-pc-windows-macho -emit-llvm -disable-free -main-file-name 1.cpp
-mrelocation-model pic -pic-level 2 -mthread-model posix -mdisable-fp-elim
-fmath-errno -masm-verbose -mconstructor-aliases -target-cpu x86-64
-dwarf-column-info -debugger-tuning=gdb -coverage-notes-file
/home/prazek/-.gcno -resource-dir
/home/prazek/llvm-build-release/lib/clang/5.0.0 -internal-isystem
/home/prazek/llvm-build-release/lib/clang/5.0.0/include -fdeprecated-macro
-fdebug-compilation-dir /home/prazek -ferror-limit 19 -fmessage-length 233
-fms-extensions -fms-compatibility -fms-compatibility-version=18 -std=c++11
-fno-threadsafe-statics -fdelayed-template-parsing -fobjc-runtime=gcc
-fcxx-exceptions -fexceptions -fdiagnostics-show-option -fcolor-diagnostics -o
- -x c++ 1.cpp 
1.      <eof> parser at end of file
2.      Per-file LLVM IR generation
clang-5.0: error: unable to execute command: Aborted (core dumped)
clang-5.0: error: clang frontend command failed due to signal (use -v to see
invocation)
clang version 5.0.0 (trunk 304553)
Target: x86_64-pc-windows-macho
Thread model: posix
InstalledDir: /home/prazek/llvm-build-release/bin
clang-5.0: note: diagnostic msg: PLEASE submit a bug report to
<a href="http://llvm.org/bugs/">http://llvm.org/bugs/</a> and include the crash backtrace, preprocessed source, and
associated run script.
clang-5.0: note: diagnostic msg: 
********************

PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:
Preprocessed source(s) and associated run script(s) are located at:
clang-5.0: note: diagnostic msg: /tmp/1-d953dc.cpp
clang-5.0: note: diagnostic msg: /tmp/1-d953dc.sh
clang-5.0: note: diagnostic msg:</pre>
        </div>
      </p>


      <hr>
      <span>You are receiving this mail because:</span>

      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>