diff options
author | Oleg Ranevskyy <oranevskyy@accesssoftek.com> | 2017-08-31 20:31:30 +0000 |
---|---|---|
committer | Oleg Ranevskyy <oranevskyy@accesssoftek.com> | 2017-08-31 20:31:30 +0000 |
commit | 80523182871bf867d553cdfbdac3d09c9cc2a0ff (patch) | |
tree | 7b723600a31152768e0084907df4a074cf4d5dda /llvm/lib/Object/WasmObjectFile.cpp | |
parent | d9063658c8ab84f970488020d1c0c26b1e488ce9 (diff) | |
download | llvm-80523182871bf867d553cdfbdac3d09c9cc2a0ff.zip llvm-80523182871bf867d553cdfbdac3d09c9cc2a0ff.tar.gz llvm-80523182871bf867d553cdfbdac3d09c9cc2a0ff.tar.bz2 |
[clang-cl] Explicitly set object format to COFF in CL mode
Summary:
Currently object format is taken from the default target triple. For toolchains with a non-COFF default target this may result in an object format inappropriate for pc-windows and lead to compilation issues.
For example, the default triple `aarch64-linux-elf` may produce something like `aarch64-pc-windows-msvc19.0.24215-elf` in CL mode. Clang creates `MicrosoftARM64TargetInfo` for such triple with data layout `e-m:w-p:64:64-i32:32-i64:64-i128:128-n32:64-S128`. On the other hand, the AArch64 backend in `computeDataLayout` detects a non-COFF target and selects `e-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128` as data layout for little endian. Different layouts used by clang and the backend cause an error:
```
error: backend data layout 'e-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128'
does not match expected target description 'e-m:w-p:64:64-i32:32-i64:64-i128:128-n32:64-S128'
```
This can be observed on the clang's Driver/cl-pch.c test with AArch64 as a default target.
This patch enforces COFF in CL mode.
Reviewers: hans
Reviewed By: hans
Subscribers: cfe-commits, aemerson, asl, kristof.beyls
Differential Revision: https://reviews.llvm.org/D37336
llvm-svn: 312275
Diffstat (limited to 'llvm/lib/Object/WasmObjectFile.cpp')
0 files changed, 0 insertions, 0 deletions