[llvm-bugs] [Bug 47120] New: Clang/LLVM Driver Crashes When Building for ARM32 MSVC Targets

via llvm-bugs llvm-bugs at lists.llvm.org
Tue Aug 11 11:00:01 PDT 2020


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

            Bug ID: 47120
           Summary: Clang/LLVM Driver Crashes When Building for ARM32 MSVC
                    Targets
           Product: clang
           Version: unspecified
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: LLVM Codegen
          Assignee: unassignedclangbugs at nondot.org
          Reporter: falhumai96 at gmail.com
                CC: llvm-bugs at lists.llvm.org, neeilans at live.com,
                    richard-llvm at metafoo.co.uk

Created attachment 23841
  --> https://bugs.llvm.org/attachment.cgi?id=23841&action=edit
Includes all the described attachments in the "Description" section above.

I am using the latest Clang/LLVM 10 from Ubuntu's repositories in Ubuntu 20. I
am trying to cross-compile a simple "Hello, world!" C++ application that
targets the MSVC ABI from Linux for the ARM32 architecture (tested with both
`armv4` and `armv7` targets). However, the driver errors out with a similar
error to the following (showing `armv4-pc-windows-msvc` target output, but
happens the same with `armv7-pc-windows-msvc` target):

```
fatal error: error in backend: Cannot select: 0x1c71840: ch = <<Unknown DAG
Node>> 0x1be3d48
In function:
??$?6U?$char_traits at D@std@@@std@@YAAAV?$basic_ostream at DU?$char_traits at D@std@@@0 at AAV10@PBD at Z
clang: error: clang frontend command failed with exit code 70 (use -v to see
invocation)
clang version 10.0.0-4ubuntu1
Target: armv4-pc-windows-msvc
Thread model: posix
InstalledDir: /usr/bin
clang: note: diagnostic msg: PLEASE submit a bug report to
https://bugs.llvm.org/ and include the crash backtrace, preprocessed source,
and associated run script.
clang: note: diagnostic msg:
********************

PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:
Preprocessed source(s) and associated run script(s) are located at:
clang: note: diagnostic msg: /tmp/hello-76cbf3.cpp
clang: note: diagnostic msg: /tmp/hello-76cbf3.sh
clang: note: diagnostic msg:

********************
```

Assuming I have mounted the `C:\Program Files (x86)` directory in my Linux
machine to `/home/user/Program_Files_(x86)`, I have attached the CC and CXX
scripts for C and C++ I am using, that wraps around the required arguments to
build the MSVC `armv4` target in `cc_arm` and `cxx_arm` scripts, respectfully.
I also attached the `hello.cpp` code I used for testing. I ran `cc_arm -o
hello_arm.exe hello.cpp` command to compile the test binary and produce the
above error.

In addition, I attached the `hello-76cbf3.cpp` and `hello-76cbf3.sh` source
code and script mentioned in the log above with the bug ticket.

I have been able to reproduce the same issue with pre-built binaries for x64
targeting MSVC ABI running directly in Windows downloadable from:
https://github.com/llvm/llvm-project/releases/download/llvmorg-10.0.0/LLVM-10.0.0-win64.exe.
However, in both cross-compiling from Linux and compiling directly in Windows,
I haven't had any issues with compiling for x64, x86, and ARM64 targets. Only
ARM32 had the above issue.

-- 
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/20200811/8f4da05e/attachment.html>


More information about the llvm-bugs mailing list