[llvm-bugs] [Bug 43375] New: Miscompilation when using map in C++ and targeting MinGW-w64

via llvm-bugs llvm-bugs at lists.llvm.org
Fri Sep 20 03:40:06 PDT 2019


https://bugs.llvm.org/show_bug.cgi?id=43375

            Bug ID: 43375
           Summary: Miscompilation when using map in C++ and targeting
                    MinGW-w64
           Product: clang
           Version: 8.0
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: normal
          Priority: P
         Component: -New Bugs
          Assignee: unassignedclangbugs at nondot.org
          Reporter: RogerKung.WIN at outlook.com
                CC: htmldeveloper at gmail.com, llvm-bugs at lists.llvm.org,
                    neeilans at live.com, richard-llvm at metafoo.co.uk

Created attachment 22537
  --> https://bugs.llvm.org/attachment.cgi?id=22537&action=edit
Test code

When using map (from STL) in C++ and targeting MinGW-w64, Clang may cause
miscompilation. I run into a MinGW-w64 runtime failure when attempting to run
the generated executable program. The error message is:
  Mingw-w64 runtime failure:
    Unknown pseudo relocation protocol version 16777216.

Moreover, when compiling with GCC, everything works fine.

The compile command I use is as follows:
  clang++ 'demo.cpp' -o 'demo.exe' -Wall -g -O2 -static-libgcc
--target=x86_64-w64-mingw -std=c++17
  g++ 'demo.cpp' -o 'demo.exe' -Wall -g -O2 -static-libgcc -std=c++17

I use Clang 8.0.1 64-bit and MinGW-w64 (GCC) 8.1.0 on Windows.

-- 
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/20190920/49bede33/attachment.html>


More information about the llvm-bugs mailing list