<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 - Mingw-w64 runtime failure"
   href="https://bugs.llvm.org/show_bug.cgi?id=39754">39754</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Mingw-w64 runtime failure
          </td>
        </tr>

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

        <tr>
          <th>Version</th>
          <td>7.0
          </td>
        </tr>

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

        <tr>
          <th>OS</th>
          <td>Windows NT
          </td>
        </tr>

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

        <tr>
          <th>Severity</th>
          <td>normal
          </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>eldlistmailingz@tropicsoft.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>blitzrakete@gmail.com, dgregor@apple.com, erik.pilkington@gmail.com, llvm-bugs@lists.llvm.org, richard-llvm@metafoo.co.uk
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Created <span class=""><a href="attachment.cgi?id=21145" name="attach_21145" title="Program to compile and link illustrating the bug.">attachment 21145</a> <a href="attachment.cgi?id=21145&action=edit" title="Program to compile and link illustrating the bug.">[details]</a></span>
Program to compile and link illustrating the bug.

In testing the Boost Parameter library using clang-7.0 32-bit targeting
mingw-w64/gcc on Windows I ran into a mingw-w64 runtime failure when attempting
to run the final command-line executable program. The full message is:

"Mingw-w64 runtime failure:
  Unknown pseudo relocation protocol version 65536.

This application has requested the Runtime to terminate it in an unusual way.
Please contact the application's support team for more information."

Using clang-6.0 32-bit targeting mingw-w64/gcc on Windows the command-line
executable program runs correctly. Using mingw-w64/gcc-8.1, which is the
backend I am using with clang-7.0, on Windows the command-line program runs
correctly. Nor does it matter what mingw-w64/gcc version I use as the backend
for clang-7.0, the runtime failure persists.

There is a bug report at <a href="https://sourceforge.net/p/mingw-w64/bugs/769/">https://sourceforge.net/p/mingw-w64/bugs/769/</a>, which
points to a bug report at
<a href="https://sourceware.org/bugzilla/show_bug.cgi?id=23872">https://sourceware.org/bugzilla/show_bug.cgi?id=23872</a>, with a fix at
<a href="https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=73af69e74974eaa155eec89867e3ccc77ab39f6d">https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=73af69e74974eaa155eec89867e3ccc77ab39f6d</a>,
which it was suggested to me on the mingw-w64 mailing list might fix the
problem I encountered. However I am unable to figure out how to build the gcc
linker for mingw-w64, ld.exe, so I am reporting these problem here as a
clang-7.0 bug.

The program illustrating the bug is called test_clang7.cpp and attached.

The compile line is:

clang++ -c -x c++ -m32 -O0 -fno-inline -w -g -target i686-pc-windows-gnu
-march=i686 -I"E:\Utilities\Boost\boost_1_68_0" -o test_clang7.obj
test_clang7.cpp

In place of the -I"E:\Utilities\Boost\boost_1_68_0" parameter in that line
please use the path to whatever recent release of Boost you have on your
machine under Windows.

The link line is:

clang++ -o test_clang7.exe -Wl,--start-group test_clang7.obj -Wl,-Bstatic
-Wl,-Bdynamic -Wl,--end-group -m32 -g -target i686-pc-windows-gnu -march=i686

This will create the test_clang.exe. If you then try to run the test_clang.exe
you will get the failure mentioned above.

I have not tried this when building the program as  64-bit executable, but I
suspect that the bug might occur there also.

The operating system I am running this on is Windows 8.1.</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>