[LLVMbugs] [Bug 22963] New: clang++ release 3.6 fails to compile using -target i386-pc-windows-msvc-elf

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Fri Mar 20 06:20:13 PDT 2015


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

            Bug ID: 22963
           Summary: clang++ release 3.6 fails to compile using -target
                    i386-pc-windows-msvc-elf
           Product: new-bugs
           Version: 3.6
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: normal
          Priority: P
         Component: new bugs
          Assignee: unassignedbugs at nondot.org
          Reporter: karl.schmidt at autodesk.com
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified

Created attachment 14079
  --> https://llvm.org/bugs/attachment.cgi?id=14079&action=edit
Example input file

When compiling using the i386-pc-windows-msvc-elf target, the compile fails
with a "backend data layout does not match expected target description" error.


  To Reproduce

bar.cpp (also attached):
-------------------------------------------------------------
int bar = 0;
-------------------------------------------------------------

clang++ -emit-llvm -target i386-pc-windows-msvc-elf -o bar.ll -c -S bar.cpp

error: backend data layout 'e-m:e-p:32:32-i64:64-f80:32-n8:16:32-S32' does not
       match expected target description
       'e-m:w-p:32:32-i64:64-f80:32-n8:16:32-S32'
1 error generated.


  Additional details

The two layouts differ only in the name mangling. It seems like the request for
ELF is not being passed to the LLVM target machine. I am guessing this is a bug
and it should in fact compile. If it is by design a clearer error message would
be appreciated.

The issue also occurs with clang and when omitting the -emit-llvm and -S flags.
clang and clang++ are 32 bit builds, created using MSVC 2012 and targeting X86
only.


Compiling works fine if not specifying ELF or for 64-bit. For instance,
compiling as

  clang++ -emit-llvm -target x86_64-pc-windows-msvc-elf -o bar.ll -c -S bar.cpp

Produces the expected output in bar.ll:
-------------------------------------------------------------
; ModuleID = 'bar.cpp'
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-windows-msvc-elf"

@"\01?bar@@3HA" = global i32 0, align 4

!llvm.module.flags = !{!0}
!llvm.ident = !{!1}

!0 = !{i32 1, !"PIC Level", i32 2}
!1 = !{!"clang version 3.6.0 (tags/RELEASE_360/final)"}
-------------------------------------------------------------


  Background

We're using clang++ to compile part of our C++ codebase to bytecode, and then
later linking that with various llvm modules at runtime. llvm 3.6 has removed
the legacy JIT and so we're moving to the MCJIT engine, which requires us to
use ELF 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/20150320/5a2b91b6/attachment.html>


More information about the llvm-bugs mailing list