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: unassignedclangb...@nondot.org
          Reporter: rogerkung....@outlook.com
                CC: htmldevelo...@gmail.com, llvm-bugs@lists.llvm.org,
                    neeil...@live.com, richard-l...@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.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to